Add Bar problems

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Dave Cox
Newbie
Newbie
Posts: 5
Joined: Tue Jul 15, 2014 12:00 am

Add Bar problems

Post by Dave Cox » Wed Jan 21, 2015 7:25 pm

Hello,

In the previous version of TeeChart (2012) the code ProfileCapacityBar.AddBar(y, XName, clTeeColor); labeled the X axis with the value in XName and when labels were displayed for the bars, the labels displayed the bar value as in the second example.

Using TeeChart 2014 the code ProfileCapacityBar.AddBar(y, XName, clTeeColor); or ProfileCapacityBar.Add(y, XName, clTeeColor); still displays the XName on the x axis, but when bar labals are displayed, the labels show the x axis name (first example).

How do I get the Add to function the same way as 2012?

Thanks,

Dave
Attachments
X Axis Error.png
X Axis Error.png (22.55 KiB) Viewed 4740 times
X Axis correct.png
X Axis correct.png (29.74 KiB) Viewed 4726 times

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: Add Bar problems

Post by Narcís » Thu Jan 22, 2015 8:39 am

Hi Dave,

The behavior you mentioned is still the same in the current version as can be seen using this code:

Code: Select all

uses Series;

procedure TForm1.FormCreate(Sender: TObject);
var i: Integer;
begin
  Chart1.AddSeries(TBarSeries.Create(Self));

  for i:=0 to 10 do
    Chart1[0].Add(random, 'point ' + IntToStr(i));
end;
You may also obtain that forcing series marks to display labels with the Marks.Style property:

Code: Select all

  Chart1[0].Marks.Style:=smsLabel;
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Dave Cox
Newbie
Newbie
Posts: 5
Joined: Tue Jul 15, 2014 12:00 am

Re: Add Bar problems

Post by Dave Cox » Thu Jan 22, 2015 1:44 pm

OK, got it.

I added the setting:

Chart.Marks.Style:=smsValue;

And the correct values are displayed.

Thanks for your help.

Dave

Post Reply