I want a 2D line chart for a list of points with x, y values.
I want 1 line, that goes threw the points, but I get 4 lines, 1 for each point.
I want the points to be in the right place, according to their numerical value. So that (1,1) point
Will be in 1 on x axis, 1 on y axis, and (7,9) point Will be in 7 on x axis, 9 on y axis.
I have this code.
List<Point> pointLs = new List<Point>(); pointLs.Add(new Point(1,1)); pointLs.Add(new Point(2, 4)); pointLs.Add(new Point(7, 9)); pointLs.Add(new Point(12, 20)); ultraChart1.DataSource = pointLs; this.ultraChart1.DataBind();
public class Point { public Point(double x, double y) { mX = x; mY = y; } private double mX; private double mY; public double Y { get { return mY; } set { mY = value; } } public double X { get { return mX; } set { mX = value; } } }
Try set this:
this.UltraChart1.Data.SwapRowsAndColumns = true;
This gives me 2 lines. one for x, and one for y.
Y want just one line, which goes threw the points.
That is probably the simplest graph you can think of.