I use the image from TCharts in reports--has worked great, until now.
My charts are not always visible in the software--occationally they may be hidden. This is by deisng. This causes a problem.
In the demo here:
http://www.TBInc.com/files/ChartToImageProblem.zip
( I included an EXE so you could see the issue)
The problem is that the chart's axis left axis may not be refreshed when the chart is rendered to a graphic.
Use the following steps to reproduce this in the demo:
1) Click on the 'Low Values' radio button. (This populates the series with smaller values then the higher one will in a moment)
2) Click on the 'Chart to Image' button to see the chart created in an image. Note the left axis matches pretty much what is shown in the chart.
3) Click on the 'Visible 'check to hide the chart.
4) Click on the 'High Values' check box to add great values to the chart.
5) Click on the 'Chart to Image' button again--and see that the left axis looks wrong--the old values are being show, it was not updated.
If this is a bug, it's a show-stopper for me.
Any help?
Thanks
Edward Dressel
Chart to Image Problem
-
- Advanced
- Posts: 228
- Joined: Tue Aug 28, 2007 12:00 am
- Location: Oregon, USA
Hi Edward,
This happens because you populate your series but the chart is not drawn. So you should force it to be calculated adding the following line at the final of your UpdateChart method:
This happens because you populate your series but the chart is not drawn. So you should force it to be calculated adding the following line at the final of your UpdateChart method:
Code: Select all
chrtActValueInGrowth.Draw;
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
-
- Advanced
- Posts: 228
- Joined: Tue Aug 28, 2007 12:00 am
- Location: Oregon, USA
AFAIK, this is a new problem, not something that has been around.9348257 wrote:This happens because you populate your series but the chart is not drawn.
I've redone the demo, where the problem seems similar. When the original chart's width is 800 and the image's width is 200, the values on the X axis overlap.
Here is how it appears correctly (the width of the original chart and the rendered image are the same):
Here is what happens when the rendered image is 1/4 the size of the original chart:
In the demo (http://www.TBInc.com/files/ChartToImageProblem.zip), simply click '200' for the image's width--the values on the X axis are incorrect.
-
- Advanced
- Posts: 228
- Joined: Tue Aug 28, 2007 12:00 am
- Location: Oregon, USA
Hi Edward,
Sorry for delay.
The last in your method "UpdateChart" is:
If you change it for the following, your problem is solved:
This is one solution but probably you could find anotherone better. The problem is that you have a big chart that you want to show in a small place. So, to show it well you'll need to draw the original chart smaller and then copy to the image (and restore the original if needed).
Also note that you call a lot of times to Draw function I pointed you before and your application doesn't seem to need it as many as you use it.
Sorry for delay.
The last in your method "UpdateChart" is:
Code: Select all
UpdateImage;
Code: Select all
if not rbtnImage800.Checked then
chrtActValueInGrowth.Width := 200;
UpdateImage;
if not rbtnImage800.Checked and rbtnChart800.Checked then
chrtActValueInGrowth.Width := 800;
Also note that you call a lot of times to Draw function I pointed you before and your application doesn't seem to need it as many as you use it.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
-
- Advanced
- Posts: 228
- Joined: Tue Aug 28, 2007 12:00 am
- Location: Oregon, USA
Obviously, I created this as a demo, not real code.
In my source code, charts will be aligned in various ways--it's not as easy as setting the width/height of the chart.
I've used this method for *years( and have never had a problem until lately--it is a new problem.
Why doesn't the axis fix itself for rendering to a canvas? The chart is passed all of the information? Especially seeing it worked before.
In my source code, charts will be aligned in various ways--it's not as easy as setting the width/height of the chart.
I've used this method for *years( and have never had a problem until lately--it is a new problem.
Why doesn't the axis fix itself for rendering to a canvas? The chart is passed all of the information? Especially seeing it worked before.
Hi Edward,
We'll investigate why changing axis' increment has no effect in the temporal chart. I've added the issue to the wish list to be fixed in further releases (TV52012836).
By meanwhile, you could use the workaround I told you before.
We'll investigate why changing axis' increment has no effect in the temporal chart. I've added the issue to the wish list to be fixed in further releases (TV52012836).
By meanwhile, you could use the workaround I told you before.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |