How to get data points from plotter???

Jan 16, 2014 at 5:45 AM
Edited Jan 16, 2014 at 6:44 AM
Hello,
please tell me how to get the coordinates of points from plotter
Image
Feb 3, 2014 at 4:29 PM
I've created an extention class for ChartPlotter
  • Get data points by LineGrapgh Description
 public static EnumerableDataSource<Point> GetPoints(this ChartPlotter plotter, string LineName)
        {
            PlotterChildrenCollection PlotterChildren = plotter.Children;

            foreach (var child in PlotterChildren.Where(lineGraph => lineGraph is LineGraph 
                && ((LineGraph)lineGraph).Description.ToString().Equals(LineName)))
            {
                return (EnumerableDataSource<Point>)((LineGraph)child).DataSource.GetPoints();
            }
            return null;
        }
  • Get data points from the first LineGraph on the ChartPlotter

        public static EnumerableDataSource<Point> GetPoints(this ChartPlotter plotter)
        {

            PlotterChildrenCollection PlotterChildren = plotter.Children;

            foreach (var child in PlotterChildren)
            {
                if (child is LineGraph)
                {
                    LineGraph lineGraph = child as LineGraph;
                    return (EnumerableDataSource<Point>)lineGraph.DataSource;
                }
            }
            return null;
        }
  • Get data points by LineGraph

        public static EnumerableDataSource<Point> GetPoints(this ChartPlotter plotter, LineGraph graph)

        {
            return (EnumerableDataSource<Point>)graph.DataSource;
        }
```