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.

2D XY chart using an array of doubles

Thread ID:

Created:

Updated:

Platform:

Replies:

100680 Aug 24,2011 11:40 AM Aug 29,2011 09:51 AM WPF 1
loading
Tags: Chart
James
Asked On August 24, 2011 11:40 AM

Does anyone know how to make a really simple 2D XY chart by just providing 2 arrays of doubles (one for the X values and one for the Y values)? It needs to work with a C++ library that I already have and I want to keep the number of classes instantiated to a minimum so I'm trying to avoid creating a lot of other classes like DataSeries etc.


Michael Prabhu M [Syncfusion]
Replied On August 29, 2011 09:51 AM

Hi James,

Thanks for using Syncfusion Products.

We have analyzed your requirement and it can be achieved by applying the below code snippet.

Code Snippet[C#]:

double[] x = new double[] { 10, 20, 30, 40, 50, 60 };
double[] y = new double[] { 20, 30, 40, 50, 60, 70 };
for (int i = 0; i < 5; i++)
{
chart1.Add(new ChartPoint() { X = x[i], Y = y[i] });
}
Series2.Data = chart1;

We have also attached a sample based on your requirement.

Thanks,
Michael Prabhu



Arrayinchart_68e5a146.zip

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.

;