Jump to content
Software FX Community

Is it possible to have two series with a different number of points.


SimonB

Recommended Posts

Is it possible to have two series with a different number of points.

My two series have the same X,Y axis but they have not the same number of points. The two axis are Double.

My series are defined as line so, do I need to add "average dummy points" to have 2 points for each X value?

Example :

Serie 1 (3 points) :

(0,0), (1,1), (2,2)

Serie 2 (4 points) :

(0,0), (1,2), (1,3), (3,3)

Here is what I'm used to do :

  allArrays[0] = serie1;

  allArrays[1] = serie2;

  allArrays[2] = XArray;

  base.DataSourceSettings.Fields.Add(new FieldMap("Field1", FieldUsage.Value));

  base.DataSourceSettings.Fields.Add(new FieldMap("Field2", FieldUsage.Value));

  base.DataSourceSettings.Fields.Add(new FieldMap("Field3", FieldUsage.XValue));

 Thanks

Simon

Link to comment
Share on other sites

Hi Simon,

you can try something like this

chart1.Gallery = Gallery.Lines;   int[] series1 = { 12, 15, 10 };   int[] series2 = { 20, 25, 7, 12, 5, 15, 3 };   string[] labels = { "1", "2", "3","4","5", "6","7"};   object[] allArrays = new object[3];   //Load Array of Arrays   allArrays[0] = series1;   allArrays[1] = series2;   allArrays[2] = labels;   ListProvider lstProvider = new ListProvider(allArrays);   chart1.DataSourceSettings.DataSource = lstProvider;

Let me know if this helped.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...