This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
hi folks, I try to generate a bar chart from code and receive a null reference exception on binding my dataseries instance to to the chart instance. this is a section of the sample code:
for (int i = 0; i < 2; i++) {
IList points = new List<object>();
for (int x = 1; x < 8; x++) {
double y2 = _random.Next(0, 15); points.Add(
new Point(x, y2));
} Mindscape.PhoneElements.Charting. BarSeries ds = new Mindscape.PhoneElements.Charting.BarSeries();
ds.ItemsSource = points; ds.BarSizeFactor = 0.5; ds.SeriesBrush = new SolidColorBrush(Colors.Blue);
ds.Title = "Afdeling " + i.ToString();
ds.Name = "Afdeling " + i.ToString();
ds.myChart.Series.Add(ds); }
The exception occurs at the last line.
Regards, Mark |
|
|
Hello Mark Thanks for your feedback. Download the nightly builds from tomorrow the 15th of March and your issue will be solved. You can alternativly set up your chart in xaml as seen below, and then set the ItemsSource in the code behind. <ch:Chart> Regards |
|