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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

2D XY chart using an array of doubles

Thread ID:





100680 Aug 24,2011 03:40 PM UTC Aug 29,2011 01:51 PM UTC WPF 1
Tags: Chart
Asked On August 24, 2011 03:40 PM UTC

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 01:51 PM UTC

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.

Michael Prabhu



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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon 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.Close Icon