We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

True 2D Scatter Plot example

I don't see a single example of one of the most common plots there.

You have an example called a scatter plot but it's not a scatter plot.

Every single example has a fixed pitch X axis.

I want to supply both the Y value AND the X Value (POSITION).

I did manage to rework one example that my munging XPATH bindings.

But I'd like to build the data up from C# and not use Binding stuff.

I've listed sample code for ComponentOne, Infragistics and Syncfusion. But the Syncfusion does not use the X value for position.

The C1 is certainly the easiest but might not be flexible. The Infragistics is extremely flexible but may have way too much overhead for the amount of data we plot.

C1 was also the easiest to figure out. The seperate solution for every example is painful with syncfusion.

I'm curious how you do this with syncfusion.

#region syncfusion
ChartListData x = new ChartListData();
for (int i = 0; i < 10; i++)
{
IChartDataPoint f;
x.AddPoint(i*i, i*2+1);
}
syncdata.Data = x;
#endregion


#region C1
var v = new DoubleCollection();
var w = new DoubleCollection();
for (int i = 0; i < 10; i++)
{
w.Add(i*i);
v.Add(i * 2 + 1);
}
s1.Values = v;
s1.XValues = w;
#endregion

#region infragistics
Series f = new Series();
f.ChartType = Infragistics.Windows.Chart.ChartType.Scatter;
for (int i = 0; i < 10; i++)
{
Infragistics.Windows.Chart.DataPoint p = new Infragistics.Windows.Chart.DataPoint();
var l = new ChartParameter();
l.Type = ChartParameterType.ValueX;
l.Value = i*i;
var m = new ChartParameter();
m.Type = ChartParameterType.ValueY;
m.Value = i*2 + 1;
p.ChartParameters.Add(l);
p.ChartParameters.Add(m);
f.DataPoints.Add(p);
}
xamChart1.Series.Add(f);


1 Reply

GM George Mills August 20, 2009 10:03 PM UTC

I figured it out.

I needed IsIndexed="False" and the example above works as expected now.


Loader.
Live Chat Icon For mobile
Up arrow icon