Jump to content
Software FX Community

Graph will not dipsplay with custom List! need help


krb875

Recommended Posts

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; }

}

}

 

}

 

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...