different bar-width after Upgrade from Vers. 8 to 2012
different bar-width after Upgrade from Vers. 8 to 2012
Hi,
I consider an upgrade from Teechart VCL 8 to 2012 but am a little confused about the different "look" of one of my projects.
Here is how the chart looked like when compiled with 8.06 (Delphi 2007):
http://www.swiftease.de/images/Screensh ... rt8.06.png
and here with the 2012 Trial Version (same Delphi installation, no change in code):
http://www.swiftease.de/images/Screensh ... 012.07.png
The bars are much thinner. I played with the Series / % Bar width value already but with no effect.
How can I return to the old look with 2012?
Thanks for advice,
Steffen
I consider an upgrade from Teechart VCL 8 to 2012 but am a little confused about the different "look" of one of my projects.
Here is how the chart looked like when compiled with 8.06 (Delphi 2007):
http://www.swiftease.de/images/Screensh ... rt8.06.png
and here with the 2012 Trial Version (same Delphi installation, no change in code):
http://www.swiftease.de/images/Screensh ... 012.07.png
The bars are much thinner. I played with the Series / % Bar width value already but with no effect.
How can I return to the old look with 2012?
Thanks for advice,
Steffen
Re: different bar-width after Upgrade from Vers. 8 to 2012
Hi Steffen,
The following example seems to look the same in v8 and in v2012 for me here. Could you please give it a try and tell us if you get the thin bars also with v8?
If you get thin Bars with your TeeChart v8 environment, could you please arrange a simple example project we can run as-is to reproduce the wide bars with v8 and thin bars with v2012 here?
Thanks in advance.
The following example seems to look the same in v8 and in v2012 for me here. Could you please give it a try and tell us if you get the thin bars also with v8?
Code: Select all
uses Chart, Series;
procedure TForm1.FormCreate(Sender: TObject);
var Chart1: TChart;
begin
Chart1:=TChart.Create(Self);
Chart1.Parent:=Self;
Chart1.Align:=alClient;
Chart1.AddSeries(TBarSeries).FillSampleValues(50);
Chart1.Axes.Bottom.SetMinMax(-0.5, 10.5);
end;
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: different bar-width after Upgrade from Vers. 8 to 2012
Hi Yeray,
... with your code I get thin bars with Ver. 2012 but thick bars with Vers. 8:
?
Best regards,
Steffen
... with your code I get thin bars with Ver. 2012 but thick bars with Vers. 8:
?
Best regards,
Steffen
Re: different bar-width after Upgrade from Vers. 8 to 2012
Hi Steffen,
Sorry, I was doing the tests with the latest v8 and I've just realized this behaviour actually changed from v8.06 to v8.07.
However, setting the TBarSeries' AutoBarSize property to true seems to work fine for me here. Could you please give it a try?
Sorry, I was doing the tests with the latest v8 and I've just realized this behaviour actually changed from v8.06 to v8.07.
However, setting the TBarSeries' AutoBarSize property to true seems to work fine for me here. Could you please give it a try?
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: different bar-width after Upgrade from Vers. 8 to 2012
Hi Yeray,
I can't use V8.07 or 8.08 because these version seem to contain a bug which lead to heavy flickering.
In V2012 I can't find an AutoBarSizeCheckbox, please state exakt location.
Best Regards,
Steffen
I can't use V8.07 or 8.08 because these version seem to contain a bug which lead to heavy flickering.
In V2012 I can't find an AutoBarSizeCheckbox, please state exakt location.
Best Regards,
Steffen
Re: different bar-width after Upgrade from Vers. 8 to 2012
... setting barseries.AutoBarSize := true in DBChart1BeforeDrawSeries had no effect in V2012, bars stay thin!
Re: different bar-width after Upgrade from Vers. 8 to 2012
Hi Steffen,
Please, create a new application just with the following code:
Using TeeChart v2012.07, I get this:
Please, check the library and search paths.
Don't you get the same?
Please, create a new application just with the following code:
Code: Select all
uses Chart, Series;
procedure TForm1.FormCreate(Sender: TObject);
var Chart1: TChart;
begin
Chart1:=TChart.Create(Self);
Chart1.Parent:=Self;
Chart1.Align:=alClient;
with Chart1.AddSeries(TBarSeries) as TBarSeries do
begin
FillSampleValues(50);
AutoBarSize:=true;
end;
Chart1.Axes.Bottom.SetMinMax(-0.5, 10.5);
end;
Don't you get the same?
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: different bar-width after Upgrade from Vers. 8 to 2012
Hi Yeray,
out last two posts have crossed.
First of all: Yes, If I execute your above code with V2012 I get the same result as you.
I think I found the problem: It occurs when Crosstab data gets involved, which is the true in my case.
I seems like every sub-series of crosstab-data need to be set to AutoBarSize := true like in your last code but as it is a crosstab, there is no .AddSeries event.
Best regards,
Steffen
out last two posts have crossed.
First of all: Yes, If I execute your above code with V2012 I get the same result as you.
I think I found the problem: It occurs when Crosstab data gets involved, which is the true in my case.
I seems like every sub-series of crosstab-data need to be set to AutoBarSize := true like in your last code but as it is a crosstab, there is no .AddSeries event.
Best regards,
Steffen
Re: different bar-width after Upgrade from Vers. 8 to 2012
Dear Yeray,
the post that I announce to have crossed with yours has not been submitted by mistake.
I mentioned therein that I already posted a bug in crosstab bar width back in 2009: http://www.teechart.net/support/viewto ... 66#p44266
The "70%" workaround you recommended and that worked nicely in V8.06 is set out of practice by setting barseries.AutoBarSize := true in DBChart1BeforeDrawSeries, as shown here:
Does it help to understand the nature of the problem?
Brgds,
Steffen
the post that I announce to have crossed with yours has not been submitted by mistake.
I mentioned therein that I already posted a bug in crosstab bar width back in 2009: http://www.teechart.net/support/viewto ... 66#p44266
The "70%" workaround you recommended and that worked nicely in V8.06 is set out of practice by setting barseries.AutoBarSize := true in DBChart1BeforeDrawSeries, as shown here:
Does it help to understand the nature of the problem?
Brgds,
Steffen
Re: different bar-width after Upgrade from Vers. 8 to 2012
Hi Steffen,
I see in that thread you posted an example but it uses a component we don't have here: Advantage Database client.
It would be helpful if you could arrange a simple example project we can run as-is to reproduce the problem here.
Thanks in advance.
I see in that thread you posted an example but it uses a component we don't have here: Advantage Database client.
It would be helpful if you could 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: different bar-width after Upgrade from Vers. 8 to 2012
Hi Yeray,
Advantage database client for Delphi is free: http://devzone.advantagedatabase.com/dz ... latform=11
It includes the local database server.
Can you run the sample now?
Brgds.
Steffen
Advantage database client for Delphi is free: http://devzone.advantagedatabase.com/dz ... latform=11
It includes the local database server.
Can you run the sample now?
Brgds.
Steffen
Re: different bar-width after Upgrade from Vers. 8 to 2012
Hi Steffen,
Note it would be preferable if we could get projects which all the dependences were on TeeChart and the components shipped with the IDE.
Anyway, I've installed Advantage Database Components as indicated and made your project run with the actual TeeChart sources.
If I run your project as-is, when I select the first, and some other series, I see the first series is wider.
If I edit the dmf ("View as Text" option at the design view) I see Series1 was set to have BarWidthPercent=75. Then, if I remove this line, or I set the BarWidthPercent to 70 as said in the thread where this was initially reported, this seems to be solved.
Then, if I zoom the chart, showing only 2 bars, I see the bar sizes don't vary. And I understand this is the behaviour you'd like to change. But adding this at OnCreate seems to change the behaviour correctly:
Note it would be preferable if we could get projects which all the dependences were on TeeChart and the components shipped with the IDE.
Anyway, I've installed Advantage Database Components as indicated and made your project run with the actual TeeChart sources.
If I run your project as-is, when I select the first, and some other series, I see the first series is wider.
If I edit the dmf ("View as Text" option at the design view) I see Series1 was set to have BarWidthPercent=75. Then, if I remove this line, or I set the BarWidthPercent to 70 as said in the thread where this was initially reported, this seems to be solved.
Then, if I zoom the chart, showing only 2 bars, I see the bar sizes don't vary. And I understand this is the behaviour you'd like to change. But adding this at OnCreate seems to change the behaviour correctly:
Code: Select all
PROCEDURE TForm1.FormCreate(Sender: TObject);
var i: Integer;
BEGIN
AdsConnection1.ConnectPath := ExtractFileDir(Application.ExeName);
AdsConnection1.IsConnected := true;
AdsQuery1.Open;
dbchart1.SeriesList.AllActive := false;
for i:=0 to DBChart1.SeriesCount-1 do
(DBChart1[i] as TBarSeries).AutoBarSize:=true;
// Series1.BarWidthPercent:=70; //use this or remove the BarWidthPercent=75 line on the dfm.
END;
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: different bar-width after Upgrade from Vers. 8 to 2012
Hi Yeray,
stupid me - I could have thought of looping through crosstab series and setting AutoBarSize after opening database as well!
In order to avoid a runtime error for other series then TBarSeries, I used this code:
for i := 0 to DBChart1.SeriesCount - 1 do
if (DBChart1 is TBarSeries) then
(DBChart1 as TBarSeries).AutoBarSize := true;
Now everything works fine, Gracias Yeray
Saludos,
Steffen
stupid me - I could have thought of looping through crosstab series and setting AutoBarSize after opening database as well!
In order to avoid a runtime error for other series then TBarSeries, I used this code:
for i := 0 to DBChart1.SeriesCount - 1 do
if (DBChart1 is TBarSeries) then
(DBChart1 as TBarSeries).AutoBarSize := true;
Now everything works fine, Gracias Yeray
Saludos,
Steffen
Re: different bar-width after Upgrade from Vers. 8 to 2012
Hi Steffen,
Glad to be helpful!
De nada, Steffen!
Glad to be helpful!
De nada, Steffen!
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |