Jump to content
Software FX Community

Extra legend item and missing data point


Mick
 Share

Recommended Posts

I am filling data for a bar chart (in a sample project) in the code-behind of my xaml file with the following code:

private void RandomizeChart()
  {
  myChart.Series.Clear();

  // Create the series and add them to the chart
  SeriesAttributes sa1 = new SeriesAttributes { Gallery = Gallery.Bar };
  myChart.Series.Add(sa1);

  Random random = new Random();

  // Set the data for the series
  for (int i = 0; i < 10; i++)
  {
  myChart.Data[0, i] = random.Next(10, 20);
  }
  }

Something I'm doing causes the following:

  • 9 points instead of 10 (the first is missing)
  • Legend entry for "Series 2"

Posted Image

What is the proper way to generate this chart in the code behind.

I ask about the code behind because I often don't have necessary data in database / xml / ItemsSource ... (i.e. bindable) format)?

---

Thank you,

Mick

Link to comment
Share on other sites

Your code works fine (only 1 series and 9 points) using our current build, can you check the version of the ChartFX.WPF.dll file?

You can download our most recent hotfix here, this page uses a control that will try to update your ChartFX files so if you have UAC enabled you must run IE as an Administrator.

JuanC

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.

 Share

×
×
  • Create New...