I'm using Delphi and Fast reports, specifically the TeeChart object inside Fast Reports. I'm trying to plot a scatter graph (preferably with a line between the points) Four points of typical X,Y data might look like this
I've set the X axis automatic to false and set a min of 0 and a max of 30.
However, when Teechart plots the points it plots the Y values at the correct height but puts them in X positions 0, 1, 2, 3 instead of 10, 15, 23, 27
This even happens when I hard code the data by setting 'Data Source' to 'Fixed Data' and putting 35;40;44;8 in the Y values box and 10;15;23;27 in the X values box.
How do I set up Teechart to plot the points at the correct X-Y coordinates?
You should use AddXY method, for example:
Series1.AddXY(10, 35);
Series1.AddXY(15, 40);
Series1.AddXY(23, 44);
Series1.AddXY(27, 8);
You should also be able to modify values like this:
Chart1[0].XValues[0]:=10;
Chart1[0].XValues[1]:=15;
Chart1[0].XValues[2]:=23;
Chart1[0].XValues[3]:=27;
Chart1[0].XValues[0]:=35;
Chart1[0].XValues[1]:=40;
Chart1[0].XValues[2]:=44;
Chart1[0].XValues[3]:=8;
That's how it should be done in TeeChart outside of FastReports. If none of those solutions works you might need to contact FastReports technical support.