Jump to content
Software FX Community

chart vanishes if resized too small?


User (Legacy)

Recommended Posts

Hi there,

I've developed a web application which allows you to dynamically resize a

window, the javascript grabs the new height and width of the resized window,

and sends it to the server. If the window contains a chart, these new size

numbers are sent to the ChartFX control to regenerate the chart to match the

new size of the window.

However, there seems to be an issue when the window is resized too small. If

a height below a certain threshold is set for the Chart, it does not draw.

It generates a totally blank image. And what "too small" is varies from

chart to chart. Some work fine up to an acceptable point, but a few will

display this behavior at what would seem to be an acceptable size for users.

I've tried this in a simple aspx page by just plopping in a ChartFX control

and resizing it through the code and recompiling it with the new sizes. It

displayed the same behavior in this setting - it vanishes when the height

drops below a certain point.

Is there anything that can be done to prevent charts from not drawing when

resized too small? Or, more importantly, what is the criteria for the chart

determing whether or not it can generate the image? If I know this, I can at

least but in a minimum for each chart so a user will never resize it small

enough to get a blank image.

Thanks,

Steve

Link to comment
Share on other sites

The typical reason why ChartFX does not draw is if the size (width or

height) is smaller than the combined size of the gaps. These gaps are

calculated so that the elements fit (e.g. the LeftGap is calculated so that

the main Y axis and/or titles fit). In order to make the chart look nice at

decent sizes we also add some space to these gaps, e.g. the TopGap is set to

a similar size to the LeftGap even though there may not be anything to draw

there.

You can set these gaps manually, when this is done ChartFX will only

increase these if it is really necessary, e.g. if you set the LeftGap to 20

pixels but the numbers in the Y axis require 40 pixels we will increase it,

but if you set the TopGap to 10 pixels and nothing is painted in that area

it will stay at 10. You could set these numbers dynamically as the chart

gets smaller. I will check if we can include some smarter defaults in future

versions.

--

Regards,

JC

Software FX Support

"Steve Orr" <Steven.Orr@tfn.com> wrote in message

news:d%23S6u8w%23DHA.196@webserver3.softwarefx.com...

> Hi there,

>

> I've developed a web application which allows you to dynamically resize a

> window, the javascript grabs the new height and width of the resized

window,

> and sends it to the server. If the window contains a chart, these new size

> numbers are sent to the ChartFX control to regenerate the chart to match

the

> new size of the window.

>

> However, there seems to be an issue when the window is resized too small.

If

> a height below a certain threshold is set for the Chart, it does not draw.

> It generates a totally blank image. And what "too small" is varies from

> chart to chart. Some work fine up to an acceptable point, but a few will

> display this behavior at what would seem to be an acceptable size for

users.

>

> I've tried this in a simple aspx page by just plopping in a ChartFX

control

> and resizing it through the code and recompiling it with the new sizes. It

> displayed the same behavior in this setting - it vanishes when the height

> drops below a certain point.

>

> Is there anything that can be done to prevent charts from not drawing when

> resized too small? Or, more importantly, what is the criteria for the

chart

> determing whether or not it can generate the image? If I know this, I can

at

> least but in a minimum for each chart so a user will never resize it small

> enough to get a blank image.

>

> Thanks,

> Steve

>

>

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...