Jump to content
Software FX Community

Flash writer and percentage width


Miguel

Recommended Posts

Hi,

When I generate the chart as a Flash control if I set the width of the chart to 100%, the flash control will use 100% of the space available, however the actual chart (plot area) will only be a small percentage of that. Is is leaving a big white gap on the right and left of the actual chart. It looks like the actual chart will keep a certain proportion between the width and the height.

However if I set the width to a number of pixels then the chart will use all the space available in the Flash control, not leaving any white margins.

Is there a way to work around this problem? I am using the Visual Studio 2005 version.

Please let me know if you need any more information.

Thanks, Miguel

Link to comment
Share on other sites

The chart is generated in the server where the client size is unknown. The chart needs to have an absolute size in order to draw. Flash can later resize this chart to any size but the effect will be a zoom effect.

I am not sure I understand what you mean by these margins. Please attach a screen-shot of both cases to clarify.

Link to comment
Share on other sites

Thanks for your prompt response.

Find attached a screenshoot that shows the white margins I was talking about. I have set the background color of the page to pink so you can appreciate the size of the flash control. Basically the Flash control is way bigger than the actual chart.

The width and the height of the chart are set to 100%.

 Any ideas on how to make the chart fit the size of the flash control (using width=100%)?

Thanks, Miguel

Link to comment
Share on other sites

Would it be possible for SoftwareFX to implement the 100% width for Flash?

Basically the client javascript that calls the server to generate the Flash control would have to pass the clientWidth and clientHeight of the parent control to the server side to generate the chart with those dimensions. Would this be possible?

 

Thanks, Miguel

Link to comment
Share on other sites

Could you please give me a hint on how I would do that? I think I am going to give it a shoot.

How would I modify the javascript generated by ChartFX in order to pass the client width and height to the rendering process?

Thanks again, Miguel

Link to comment
Share on other sites

  • 7 months later...

Hello Meguel,

I am also facing similar problem where I am getting lot of white space aroung the chart when I am render my chart in SVG format having height/width define in percentage.

Can you please let me know how did you solved your problem.

I will really appriciate your help

Thanks

Link to comment
Share on other sites

  • 4 months later...

I have prepared a sample on how to display a chart that takes 100% of the page and automatically resizes when the page does. It is basically a chart wrapped by a DIV (DIVs take percentages as width and height). It uses the getBoundingClientRect() method to grab the actual number of pixels of the DIV (after the page loads) and resizes the chart using a callback.

The sample shows it done when you render the chart as an image and as a SVG. If you have any questions, feel free to contact me at support.softwarefx.com (replace the first "." with "@").

---

AndreG

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...