Problem with TPointSeries and Xaxis

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
DiagnosysUK
Newbie
Newbie
Posts: 2
Joined: Fri May 02, 2014 12:00 am

Problem with TPointSeries and Xaxis

Post by DiagnosysUK » Wed Jun 04, 2014 2:54 pm

Hi
I am trying to create a Tchart at runtime and connect a set of TFastline series and TpointSeries to it. I want to set the X axis and Y axis to absolute values and plot both lines and points on the graph at various coordinates. This works fine. However

If I create TpointSeries and then use "AddXY(x,y,string)" where string is the label of the point this screws up the X axis scaling. If I use "AddXY(x,y)" this works. I want to keep the X axis scaling as set, but also be able to show a label at each point. I have attached a form showing the problem. I have set "bottomaxis.automatic:=false"

Secondly, when I show the point label I would like to be able to position it relative to the point coordinate as the label is a little close to the point shape

Thanks
Richard

DiagnosysUK
Newbie
Newbie
Posts: 2
Joined: Fri May 02, 2014 12:00 am

Re: Problem with TPointSeries and Xaxis

Post by DiagnosysUK » Wed Jun 04, 2014 4:26 pm

Ah

I fixed the main problem. I need to set the TChart.Axes.Bottom.LabelStyle:=talvalue; But it would be nice to be able to manipulate the position of the point label relative to the point

Yeray
Site Admin
Site Admin
Posts: 9602
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Problem with TPointSeries and Xaxis

Post by Yeray » Thu Jun 05, 2014 9:13 am

Hi Richard,
DiagnosysUK wrote:I am trying to create a Tchart at runtime and connect a set of TFastline series and TpointSeries to it. I want to set the X axis and Y axis to absolute values and plot both lines and points on the graph at various coordinates. This works fine. However

If I create TpointSeries and then use "AddXY(x,y,string)" where string is the label of the point this screws up the X axis scaling. If I use "AddXY(x,y)" this works. I want to keep the X axis scaling as set, but also be able to show a label at each point. I have attached a form showing the problem. I have set "bottomaxis.automatic:=false"
DiagnosysUK wrote:I fixed the main problem. I need to set the TChart.Axes.Bottom.LabelStyle:=talvalue;
Having labels in a series makes the bottom axis to show these strings if the axis has the default LabelStyle talAuto. As you've observed, forcing it to talValue makes the axis to still calculate the axis labels as if the series didn't have labels.
DiagnosysUK wrote:Secondly, when I show the point label I would like to be able to position it relative to the point coordinate as the label is a little close to the point shape
DiagnosysUK wrote:But it would be nice to be able to manipulate the position of the point label relative to the point
I'm not sure to see what are you exactly trying to do here.
If you want an axis label at each series point, you can set LabelStyle to talAuto/talText.
If you want an axis label at each series point but displaced with an offset, you should use custom labels. You can find an example of the custom axis labels at "All Features\Welcome !\Axes\Labels\Custom Labels" in the features demo included with the installation.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply