krb875 Posted June 11, 2008 Report Share Posted June 11, 2008 my class is inheriting Window, altho I have tried it with usercontrol as well. when I make a list of doubles and add it to the series and then to the item source everything works perfectly. When I make a list of XYMeasure (stole from the example). The code will not display the graph and I get a null pointer exception when I call show dialog. code is below: thanks! double Scale = 20; this.m_Report.chart1.ItemsSource = null;this.m_Report.chart1.AxisX.ScaleUnit = 1 / Scale; double location = -40;for (int k = 0; k < value.Length; k++) {ChartFX.WPF.SeriesAttributes series = new ChartFX.WPF.SeriesAttributes(); List<ProcessDataSummary.XYMeasure> dataPts = new List<ProcessDataSummary.XYMeasure>();for (int i = 0; i < value[k].Length; i++) {dataPts.Add(new ProcessDataSummary.XYMeasure(location, value[k])); location += Scale; } series.ItemsSource = dataPts; this.m_Report.chart1.Series.Add(series); } this.m_Report.showDialog(); here is a copy of XYMeasure namespace ProcessDataSummary { public class XYMeasure { private double m_x; private double m_y;public XYMeasure(double x, double y) { m_x = x; m_y = y; } public double X { get { return m_x; } } public double Y { get { return m_y; } } } } Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.