Page 1 of 1

Problem with TPointSeries and Xaxis

Posted: Wed Jun 04, 2014 2:54 pm
by 16469124
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

Re: Problem with TPointSeries and Xaxis

Posted: Wed Jun 04, 2014 4:26 pm
by 16469124
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

Re: Problem with TPointSeries and Xaxis

Posted: Thu Jun 05, 2014 9:13 am
by yeray
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.