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.
Unfortunately, activation email could not send to your email. Please try again.

True 2D Scatter Plot example

Thread ID:

Created:

Updated:

Platform:

Replies:

89266 Aug 20,2009 05:22 PM Aug 20,2009 06:03 PM WPF 1
loading
Tags: Chart
George Mills
Asked On August 20, 2009 05:22 PM

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);


George Mills
Replied On August 20, 2009 06:03 PM

I figured it out.

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


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;