2

Using a TChart line graph I want to allow users to optionally rotate the plots. This is to say it will draw (Y,-X) instead of (X,Y), but when the plots are drawn, the sequence of point changes and points connect to each other based on increasing values of first argument. You can see the results in the following pictures:

Normal

Normal Graph

Rotated

Rotated Graph

I use .AddXY to add the points to the series that I want to plot:

TChartGraph.Series[TheSeries].AddXY(GetXorY(TheValue),-SegOrDepthLiqSI)

Any idea idea how can I force the code to connect the points in the order that I want?

kobik
  • 21,001
  • 4
  • 61
  • 121
hamid
  • 51
  • 6

1 Answers1

4

This is actually poorly documented. When adding XY values the default behaviour is to sort the value pairs by x-value. To disable this for degenerate graphs which must link in the added-order you simply do :

Chart1.Series[0].XValues.Order := loNone;

This property must be set before adding values to the series. You can also set this property at design time here :

enter image description here

J...
  • 30,968
  • 6
  • 66
  • 143
  • Thanks a lot for your answer. I don't know why my text has got messed up after I have upload my question. – hamid Nov 16 '15 at 15:49
  • @hamid your question was edited by myself and other users to improve readability and formatting. This is done to help other readers better understand your question as well as to assist others, with a similar problem, find your question in the future. – J... Nov 16 '15 at 16:03
  • Thanks J... Adding the code line was much more handy. – hamid Nov 17 '15 at 14:42