Opened 8 years ago

Closed 8 years ago

#12293 closed enhancement (fixed)

[patch][ccla] Make sure charts width/height defined as percentage can

Reported by: cjolif Owned by: Eugene Lazutkin
Priority: high Milestone: 1.6
Component: Charting Version: 1.6.0b1
Keywords: Cc:
Blocked By: Blocking:

Description

Currently if you specify a width/height in percentage for the chart you have no way on window resize to update the size of the chart with the current actual pixels width/height computed from the percentages. This is currently impossible because the percentage values are overriden by pixel values by the resize() method of the chart.

This patch implements a new contract on resize() method that if there is no argument, the internal surface is resized to the actual pixel witdth/height but the dom node keeps its percentage values.

See also:

https://docs.google.com/document/d/1WM1UeXGZKgUSzL94TzRbr3dNEHiMzSJvy7pZep8yyAw/edit?hl=fr&authkey=CL7IjbIM#

A test case is attached. To see the issue without the patch, resize the window, the chart is not resized. Do the same with the patch the chart is resized.

Note: this is not working with IE (VML), because GFX in VML mode is explicitly overriding the size of the containing div to put the size of the surface. See vml.createSurface, in particular:

p.style.width  = width;
p.style.height = height;

Same thing applies to dojox.gfx.vml.Surfaceset.Dimensions

I tried removing those calls without noticing any issue.

Attachments (2)

test_resize.html (1.5 KB) - added by cjolif 8 years ago.
test case
sizing.patch (2.6 KB) - added by cjolif 8 years ago.

Download all attachments as: .zip

Change History (5)

Changed 8 years ago by cjolif

Attachment: test_resize.html added

test case

comment:1 Changed 8 years ago by cjolif

Make sure charts width/height defined as percentage can -> Make sure charts width/height defined as percentage can be map to corresponding pixel values on window resize

Changed 8 years ago by cjolif

Attachment: sizing.patch added

comment:2 Changed 8 years ago by Eugene Lazutkin

Milestone: tbd1.6

comment:3 Changed 8 years ago by Eugene Lazutkin

Resolution: fixed
Status: newclosed

(In [23834]) charting: more accurate work with chart dimensions, thx cjolif!, !strict, fixes #12293.

Note: See TracTickets for help on using tickets.