Issues with self stacked bar chart
Issues with self stacked bar chart
I just upgraded fom V6 to V7.06 and now experience several problems with a self stacked bar chart.
To reproduce them, please create a self stacked horizontal bar chart with "color Each" activated and a Bar Width of 100%.
Now change the "Points per Page" between 0, 1 and 2. The resulting charts look really strange and none of them as expected.
What I am trying to do is a self stacked bar chart with one bar that fills with a horizontal and vertical size of 100% of the chart. That was working quite OK with V6.
To reproduce them, please create a self stacked horizontal bar chart with "color Each" activated and a Bar Width of 100%.
Now change the "Points per Page" between 0, 1 and 2. The resulting charts look really strange and none of them as expected.
What I am trying to do is a self stacked bar chart with one bar that fills with a horizontal and vertical size of 100% of the chart. That was working quite OK with V6.
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Joschi,
Thanks for the report. This is a bug which I'm going to add to our defect list to be fixed for future releases.
In the meantime, you could try creating as many series as points has the original series and set them to stacked instead of self stack the original series.
Thanks for the report. This is a bug which I'm going to add to our defect list to be fixed for future releases.
In the meantime, you could try creating as many series as points has the original series and set them to stacked instead of self stack the original series.
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Joschi,
or
We can't commit to a date for now as the bug (TV52011179) is still not fixed. However, it has a high priority on our defect list. I'd suggest you to be aware at the release notes at our Version Info page.When can we expect a version in that this bug is fixed?
Yes, you can do:Can you provide sample code how to create the series at runtime?
Code: Select all
procedure TForm1.FormCreate(Sender: TObject);
begin
Chart1.AddSeries(THorizBarSeries.Create(self));
Chart1[0].FillSampleValues();
end;
Code: Select all
procedure TForm1.FormCreate(Sender: TObject);
var
HorizBar1: THorizBarSeries;
begin
HorizBar1:=THorizBarSeries.Create(self);
Chart1.AddSeries(HorizBar1);
HorizBar1.FillSampleValues();
end;
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Hi Narcis,
thanks for the code. I was able to add the BarSeries at runtime, but have some problems sorting them. Before I was using
or
How can achieve similar sorting when I have stacked series instead of a self stacked chart?
thanks for the code. I was able to add the BarSeries at runtime, but have some problems sorting them. Before I was using
Code: Select all
BarSeries.XValues.Order := loDescending
Code: Select all
BarSeries.SortByLabels;
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi Joschi,
Yes, this is because each series only has one value and this value represents the 100% of this series. To get the behaviour you request you can do something like:
Yes, this is because each series only has one value and this value represents the 100% of this series. To get the behaviour you request you can do something like:
Code: Select all
procedure TForm1.FormCreate(Sender: TObject);
var
i: Integer;
val: Double;
begin
Randomize;
Total:=0;
for i:=0 to Chart1.SeriesCount-1 do
begin
val:=random(100);
Total:=Total+val;
Chart1[i].Add(val);
Chart1[i].OnGetMarkText:=Series1GetMarkText;
end;
end;
procedure TForm1.Series1GetMarkText(Sender: TChartSeries;
ValueIndex: Integer; var MarkText: String);
begin
MarkText:=FloatToStr((Sender.YValue[0]/Total)*100)+'%';
end;
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
What is still missing is the answer to my question how to sort the Series similar to the values. Before I was using:
or
And is it possible that adding TBarSeries to a chart is much slower than adding values to a self stacked bar chart? I experienced that my applications is much slower when creating the chart for a lot of values now.
A lot of workarounds are now necessary to overcome this bug. With V6 I was able to create this chart with only a few lines of code. I just paid good money for the update to V7 and now have all these problems and loose a lot of time because of them. Please make sure that I get until the end of this month what I paid for: A fixed version of TeeChart7 that allows me to create this simple chart!
Code: Select all
BarSeries.XValues.Order := loDescending
Code: Select all
BarSeries.SortByLabels;
A lot of workarounds are now necessary to overcome this bug. With V6 I was able to create this chart with only a few lines of code. I just paid good money for the update to V7 and now have all these problems and loose a lot of time because of them. Please make sure that I get until the end of this month what I paid for: A fixed version of TeeChart7 that allows me to create this simple chart!
Hi Joschi,
about the order, you could use the following code :
about the order, you could use the following code :
Code: Select all
procedure TForm1.FormCreate(Sender: TObject);
var bar1,bar2,bar3 : THorizBarSeries;
i: integer;
procedure Sort();
var i,j:integer;
begin
with Chart1 do
for i:=0 to SeriesCount-1 do
for j:= 0 to i-1 do
if Chart1[j].Xvalues[0] < Chart1[i].Xvalues[0] then
begin
ExchangeSeries(j,i);
end;
Chart1.Invalidate;
end;
begin
Chart1.View3D:=false;
with Chart1 do
begin
for i := 0 to 2 do
begin
AddSeries(THorizBarSeries.Create(Chart1));
with Chart1[i] as THorizBarSeries do
begin
Add(random(30));
MultiBar:=mbStacked;
BarWidthPercent:=100;
SideMargins:=false;
end;
end;
end;
Sort();
end;
Adding values to Series that are stacked or not should be the same.And is it possible that adding TBarSeries to a chart is much slower than adding values to a self stacked bar chart?
Sorry for the inconvenience this could cause, we'll try to fix this problem as soon as possible, however I've tried witht he v6.01 and the same problem happens, which TeeChart version and maintenance release are you using ? Could you please post here the complete code you're using the with v6 so I can compare with the v7 ?A lot of workarounds are now necessary to overcome this bug. With V6 I was able to create this chart with only a few lines of code. I just paid good money for the update to V7 and now have all these problems and loose a lot of time because of them. Please make sure that I get until the end of this month what I paid for: A fixed version of TeeChart7 that allows me to create this simple chart!
Pep Jorge
http://support.steema.com
http://support.steema.com
Thank you for the sorting code. Unfortunately it further slows down the creation of the chart.
I also encountered that the application now uses 10-30 MB RAM for each chart that I create that way. This is absolutely unacceptable.
(Compare this amount of code to all your workarounds!)
To reproduce the bugs, you don't need to write any code, simply follow the inbstructions of my initial posting:
Please create a self stacked horizontal bar chart with "color Each" activated and a Bar Width of 100%. Now change the "Points per Page" between 0, 1 and 2. The resulting charts look really strange and none of them as expected.
Regards,
Joachim
But according to you workaround I additionally need to create a TBarSeries for each value. And creating all these ChartSeries seems to take much more time that just adding these values to an existing series. Can you confirm this?Adding values to Series that are stacked or not should be the same.
I also encountered that the application now uses 10-30 MB RAM for each chart that I create that way. This is absolutely unacceptable.
I am currently using TeeChart V7.06.Sorry for the inconvenience this could cause, we'll try to fix this problem as soon as possible, however I've tried witht he v6.01 and the same problem happens, which TeeChart version and maintenance release are you using?
The original code that was working with TeeeChart V6 is rahter straight forward and looks like this:Could you please post here the complete code you're using the with v6 so I can compare with the v7 ?
Code: Select all
for i:=0 to Count-1 do begin
ChartSeries.Add(value[i], Caption[i]);
end;//for i
if SortType = stSize then
ChartSeries.XValues.Order := loDescending
else
ChartSeries.SortByLabels;
To reproduce the bugs, you don't need to write any code, simply follow the inbstructions of my initial posting:
Please create a self stacked horizontal bar chart with "color Each" activated and a Bar Width of 100%. Now change the "Points per Page" between 0, 1 and 2. The resulting charts look really strange and none of them as expected.
OK, when approximately can I expect a fix? Your workarounds are simply too slow and too memory consuming. Creating the chart now take about 4-5 seconds, previously it was about 0.5 seconds.we'll try to fix this problem as soon as possible
Regards,
Joachim
Hi Joschi,
Yes, of course, you're correct, I was thinking you was telling that it takes more time adding values to not stacked series than stacked ones.But according to you workaround I additionally need to create a TBarSeries for each value. And creating all these ChartSeries seems to take much more time that just adding these values to an existing series. Can you confirm this?
I've tried with the v6.01 and I'm getting the same results. Can you confirm it works with the v6.01 of just with v6. Also, would you be so kind to send me a simple example used in v6 directly to [email protected] so I can test it ?The original code that was working with TeeeChart V6 is rahter straight forward and looks like this:
We'll try to fix it for the next maintenance release v7.07 which will be out soon (before the end of Feb 2006).OK, when approximately can I expect a fix? Your workarounds are simply too slow and too memory consuming. Creating the chart now take about 4-5 seconds, previously it was about 0.5 seconds.
Pep Jorge
http://support.steema.com
http://support.steema.com