09-25-2016 12:51 AM
graph.DataSource= ChartCollection<PointI>
graph.plot=PointPlotRenderer
run error:
Could not find conversion from type PointI to type Double.
public struct PointI : IFormattable
{
public PointI(double x, double y)
{
X = x;
Y = y;
}
public double X { get; set; }
public double Y { get; set; }
public string ToString(string format, IFormatProvider formatProvider)
{
//throw new NotImplementedException();
return string.Format("{0},{1}", X, Y);
}
}
Solved! Go to Solution.
09-26-2016 12:35 PM - edited 09-26-2016 12:46 PM
To use a custom data type with the graph, you need to also implement a descriptor so the graph knows how to access your data. I have attached a descriptor from another question, translated to C# for your data type.
To use the descriptor, add a DataTypeDescriptor attribute to your custom type:
[DataTypeDescriptor( typeof( PointIDescriptor ) )]
public struct PointI : IFormattable {
// ...
}