public static PlotModel CreateAndPrintChart( this StatisticsCollection statisticalQuantities, string filePath, string chartName, ChartType chartType = ChartType.Line, int width = 640, int height = 480, ChartImageFormat imageFormat = ChartImageFormat.Png) { var dataCollection = CreateDataPointCollection(statisticalQuantities); //ignore if no data if (dataCollection.Count == 0) { return(null); } //creates chart var chartModel = PlottingUtil.CreateAndPrintChart( dataCollection, filePath, chartName, chartType, width, height, imageFormat); return(chartModel); }