Hi
I have come accross a strange issue and not sure how to proceed. When I run the same code for all other charts the data looks ok except for the horizontal chart where the values come out being very high. I have attached two charts the vertical is the correct data that is being passed from the datasource but the horizontal one is coming out with values like 41,527.
This seems to be occuring because I am setting the ChartSeries.XValues.ValueSource := '#SUM#' + FieldName on a Horizontal barchart. However, It seems to work when I set ChartSeries.YValues.ValueSource := '#SUM#' + FieldName for a vertical bar chart. This logic worked on the version 8 TeeChart so I was wondering if there is something I need to do for the new version of the TeeChart
Horizontal Barchart giving high values
Horizontal Barchart giving high values
- Attachments
-
- Wrong Data
- Horizontal.jpg (37.71 KiB) Viewed 12257 times
-
- Correct Data
- Vertical.jpg (25.79 KiB) Viewed 12227 times
Re: Horizontal Barchart giving high values
Hello,
I'm not sure if the problem is in how are you configuring the data for the HorizBar or if there's a problem in the component.
Could you please arrange a simple example project we can run as-is to reproduce the problem here?
Thanks in advance.
I'm not sure if the problem is in how are you configuring the data for the HorizBar or if there's a problem in the component.
Could you please arrange a simple example project we can run as-is to reproduce the problem here?
Thanks in advance.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Horizontal Barchart giving high values
Hi
It maybe something to do with our implementation but it would not be that easy to create an example because it was all database driven. I spent some time comparing the source code of version 8 and version 2014 and what I found was that in the unit DBChart.pas, the Procedure ProcessRecord(const tmpSeries:TDBChartSeries) had the lines below that were commented in 2014. Uncommenting those lines brought the numbers back to normal for a horizontal chart
else
tmpNotMand:=0;
However, when the data wasn't ordered it didn't look right so in Procedure AddToSeries(const DestSeries:TDBChartSeries) I commented out the ASeries.AddXY(..) i.e
//if (GroupPrefix=dgNone) then
ASeries.Add(tmpMand,tmpXLabel,tmpColor)
// else
// ASeries.AddXY(tmpNotMand,tmpMand,tmpXLabel,tmpColor);
This seems to make the horizontal chart work but I am not sure what the full implications of those changes are.
It maybe something to do with our implementation but it would not be that easy to create an example because it was all database driven. I spent some time comparing the source code of version 8 and version 2014 and what I found was that in the unit DBChart.pas, the Procedure ProcessRecord(const tmpSeries:TDBChartSeries) had the lines below that were commented in 2014. Uncommenting those lines brought the numbers back to normal for a horizontal chart
else
tmpNotMand:=0;
However, when the data wasn't ordered it didn't look right so in Procedure AddToSeries(const DestSeries:TDBChartSeries) I commented out the ASeries.AddXY(..) i.e
//if (GroupPrefix=dgNone) then
ASeries.Add(tmpMand,tmpXLabel,tmpColor)
// else
// ASeries.AddXY(tmpNotMand,tmpMand,tmpXLabel,tmpColor);
This seems to make the horizontal chart work but I am not sure what the full implications of those changes are.
Re: Horizontal Barchart giving high values
Hello,
You can try to set a simple example using "TeeChart Pro Database" shipped with the installation to show us the unexpected result.
You can try to set a simple example using "TeeChart Pro Database" shipped with the installation to show us the unexpected result.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Horizontal Barchart giving high values
I have modified the DB project you included in the example to show the error with the horizontal chart. When you change the series to a Barchart, the numbers are correct. The project was modified using Delphi XE6
- Attachments
-
- DBChart Aggregates.zip
- (6.91 KiB) Downloaded 781 times
Re: Horizontal Barchart giving high values
Hello,
I had to change the Database name from "DBDEMOS" to "TeeChart Pro Database", clear and add all the fields on the table and to run the example here.
So I want to check I'm getting the same result than you:
I had to change the Database name from "DBDEMOS" to "TeeChart Pro Database", clear and add all the fields on the table and to run the example here.
So I want to check I'm getting the same result than you:
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Horizontal Barchart giving high values
yes, thats correct. That was what I was getting