public static LineGraph AddLineGraph(this Plotter2D plotter, IPointDataSource pointSource, Pen linePen, Description description) { if (pointSource == null) { throw new ArgumentNullException("pointSource"); } if (linePen == null) { throw new ArgumentNullException("linePen"); } LineGraph graph = new LineGraph { DataSource = pointSource, LinePen = linePen }; if (description != null) { NewLegend.SetDescription(graph, description.Brief); graph.Description = description; } // graph.Filters.Add(new InclinationFilter()); graph.Filters.Add(new FrequencyFilter()); plotter.Children.Add(graph); return(graph); }
/// <summary> /// Adds one dimensional graph. /// </summary> /// <param name="pointSource">The point source.</param> /// <param name="description">The description.</param> /// <returns></returns> public static LineGraph AddLineGraph(this Plotter2D plotter, IPointDataSource pointSource, string description) { LineGraph graph = AddLineGraph(plotter, pointSource); graph.Description = new PenDescription(description); NewLegend.SetDescription(graph, description); return(graph); }
public static LineAndMarker <ElementMarkerPointsGraph> AddLineGraph(this Plotter2D plotter, IPointDataSource pointSource, Pen linePen, ElementPointMarker marker, Description description) { if (pointSource == null) { throw new ArgumentNullException("pointSource"); } var res = new LineAndMarker <ElementMarkerPointsGraph>(); if (linePen != null) // We are requested to draw line graphs { LineGraph graph = new LineGraph { DataSource = pointSource, LinePen = linePen }; if (description != null) { NewLegend.SetDescription(graph, description.Brief); graph.Description = description; } if (marker == null) { // Add inclination filter only to graphs without markers // graph.Filters.Add(new InclinationFilter()); } graph.Filters.Add(new FrequencyFilter()); res.LineGraph = graph; plotter.Children.Add(graph); } if (marker != null) // We are requested to draw marker graphs { ElementMarkerPointsGraph markerGraph = new ElementMarkerPointsGraph { DataSource = pointSource, Marker = marker }; res.MarkerGraph = markerGraph; plotter.Children.Add(markerGraph); } return(res); }