Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#16654 closed defect (invalid)

Chart: resize broken with one arguments (width)

Reported by: Mathevet julien Owned by: Eugene Lazutkin
Priority: undecided Milestone: tbd
Component: Charting Version: 1.8.3
Keywords: Cc:
Blocked By: Blocking:

Description

chart resize method doesn't work if you specified only width. Here CLA patch:

Index: Chart.js
===================================================================
--- Chart.js    (révision 30449)
+++ Chart.js    (copie de travail)
@@ -635,8 +635,7 @@
                                // case 0, do not resize the div, just the surface
                                case 1:
                                        // argument, override node box
-                                       box = lang.mixin({}, width);
-                                       domGeom.setMarginBox(this.node, box);
+                                       domGeom.setMarginBox(this.node, {w: width});
                                        break;
                                case 2:
                                        box = {w: width, h: height};

Change History (6)

comment:1 Changed 7 years ago by cjolif

moogle, I think (even if I agree this is not very clear) the intend was that when only a single argument is used the resize take that argument as a box definition not a single width.

See the method description:

"If no width/height or box is provided, resize the surface to the marginBox of the chart."

(or box means you can pass the box as parameter)

That also what Dijit is advertising:

http://livedocs.dojotoolkit.org/dijit/layout#resizing

Based on that I would tend to close that as invalid but make the doc clearer. Except if you have some references to some doc / examples that shows that my interpretation is incorrect?

comment:2 Changed 7 years ago by Mathevet julien

ok you're right. Set ticket to invalid. Just need to update width param doc. Sorry about to loose your time. I was disturbed by width param.

comment:3 Changed 7 years ago by cjolif

In [30516]:

refs #16654. Improve the resize method doc and clean a little bit the code.

comment:4 Changed 7 years ago by cjolif

Resolution: invalid
Status: newclosed

comment:5 Changed 7 years ago by cjolif

In [30626]:

refs #16654. Adjust widget/Chart.js to latest changes in Chart.js

comment:6 Changed 7 years ago by cjolif

In [30652]:

refs #16654. Make the correct widget/Chart.js fix this time.

Note: See TracTickets for help on using tickets.