/// <summary> /// Affected by <see cref="SimpleFrameGenerator.NonZeroesOnly"/> /// </summary> public static DFIntColumn CreateIntCol(string name, int rowCount) { int[] data = new int[rowCount]; Random rand = new Random(); for (int i = 0; i < rowCount; i++) { data[i] = NextInt(rand, 100); } DFIntColumn col = new DFIntColumn(name, data); return col; }
public static Frame CreateFrame(int[] values, string colName) { DFColumn[] cols = new DFColumn[1]; cols[0] = new DFIntColumn(colName, values); Frame frame = new Frame(Guid.NewGuid(), cols); return frame; }
public static Frame CreateFrame(double[] values, bool[] values1, int[] values2) { DFColumn[] cols = new DFColumn[3]; cols[0] = new DFNumericColumn("col 0", values); cols[1] = new DFBoolColumn("col 1", values1); cols[2] = new DFIntColumn("col 2", values2); Frame frame = new Frame(Guid.NewGuid(), cols); return frame; }
/// <summary> /// Returns a new line chart for the given columns. /// </summary> /// <param name="data">The data.</param> /// <returns>A new chart.</returns> /// <remarks> /// Non-numeric columns are ignored. /// </remarks> public static ChartControl ToChart( DFIntColumn[] data ) { ChartControl chart = GetDefaultChart(); Update( ref chart, data ); return chart; }
public static Frame CreateFrame(int[] values, int[] values2) { DFColumn[] cols = new DFColumn[2]; cols[0] = new DFIntColumn("col 0", values); cols[1] = new DFIntColumn("col 1", values2); Frame frame = new Frame(Guid.NewGuid(), cols); return frame; }
/// <summary> /// Returns a line chart containing the given column data. /// </summary> /// <param name="y">The y values.</param> /// <param name="xUnits">The units for the x-axis.</param> /// <returns>A new chart.</returns> public static ChartControl ToChart( DFIntColumn y, Unit xUnits ) { ChartControl chart = GetDefaultChart(); Update( ref chart, y, xUnits ); return chart; }
/// <summary> /// Returns a new point (scatter) chart containing the given x-y data. /// </summary> /// <param name="x">The x values.</param> /// <param name="y">The y values.</param> /// <returns>A new chart.</returns> /// <exception cref="MismatchedSizeException">Thrown if x and y have different lengths.</exception> public static ChartControl ToChart( DFIntColumn x, DFIntColumn y ) { ChartControl chart = GetDefaultChart(); Update( ref chart, x, y ); return chart; }
/// <summary> /// Shows a new chart in a default form. /// </summary> /// <param name="data">The data.</param> /// <remarks> /// Non-numeric columns are ignored. /// <br/> /// Equivalent to: /// <code> /// NMathStatsChart.Show( ToChart( data ) ); /// </code> /// </remarks> public static void Show( DFIntColumn[] data ) { Show( ToChart( data ) ); }
/// <summary> /// Shows a new chart in a default form. /// </summary> /// <param name="data">The data.</param> /// <param name="xUnits">The units for the x-axis.</param> /// <remarks> /// Non-numeric columns are ignored. /// <br/> /// Equivalent to: /// <code> /// NMathStatsChart.Show( ToChart( data, xUnits ) ); /// </code> /// </remarks> public static void Show( DFIntColumn[] data, Unit xUnits ) { Show( ToChart( data, xUnits ) ); }
/// <summary> /// Shows a new chart in a default form. /// </summary> /// <param name="y">The y values.</param> /// <param name="xUnits">The units for the x-axis.</param> /// <remarks> /// Equivalent to: /// <code> /// NMathStatsChart.Show( ToChart( y, xUnits ) ); /// </code> /// </remarks> public static void Show( DFIntColumn y, Unit xUnits ) { Show( ToChart( y, xUnits ) ); }
/// <summary> /// Shows a new chart in a default form. /// </summary> /// <param name="x">The x values.</param> /// <param name="y">The y values.</param> /// <exception cref="MismatchedSizeException">Thrown if x and y have different lengths.</exception> /// <remarks> /// Equivalent to: /// <code> /// NMathStatsChart.Show( ToChart( x, y ) ); /// </code> /// </remarks> public static void Show( DFIntColumn x, DFIntColumn y ) { Show( ToChart( x, y ) ); }
/// <summary> /// Updates the given chart with the given data. /// </summary> /// <param name="chart">A chart.</param> /// <param name="data">The data.</param> /// <param name="xUnits">The units for the x-axis.</param> /// <remarks> /// Non-numeric columns are ignored. /// <br/> /// Titles are added only if chart does not currently contain any titles. /// <br/> /// The first data.Length data series are replaced, or added if necessary. /// </remarks> public static void Update( ref ChartControl chart, DFIntColumn[] data, Unit xUnits ) { string title = "DFIntColumn[]"; string xTitle = xUnits.Name; string yTitle = "Value"; List<ChartSeries> seriesList = new List<ChartSeries>(); for( int i = 0; i < data.Length; i++ ) { if( data[i].IsNumeric ) { ChartSeries series = BindXY( xUnits.ToDoubleVector( data[i].Count ), data[i], ChartSeriesType.Line, ChartSymbolShape.None ); series.Text = data[i].Name; seriesList.Add( series ); } } Update( ref chart, seriesList, title, xTitle, yTitle ); }
/// <summary> /// Updates the given chart with the given data. /// </summary> /// <param name="chart">A chart.</param> /// <param name="data">The data.</param> /// <remarks> /// Non-numeric columns are ignored. /// <br/> /// Titles are added only if chart does not currently contain any titles. /// <br/> /// The first data.Length data series are replaced, or added if necessary. /// </remarks> public static void Update( ref ChartControl chart, DFIntColumn[] data ) { Update( ref chart, data, new Unit() ); }
/// <summary> /// Updates the given chart with the given x-y data. /// </summary> /// <param name="chart">A chart.</param> /// <param name="x">The x values.</param> /// <param name="y">The y values.</param> /// <exception cref="MismatchedSizeException">Thrown if x and y have different lengths.</exception> /// <remarks> /// Titles are added only if chart does not currently contain any titles. /// <br/> /// chart.Series[0] is replaced, or added if necessary. /// </remarks> public static void Update( ref ChartControl chart, DFIntColumn x, DFIntColumn y ) { string title = "DFIntColumn vs. DFIntColumn"; string xTitle = "x"; string yTitle = "y"; ChartSeries series = BindXY( x, y, ChartSeriesType.Scatter, DefaultMarker ); Update( ref chart, series, title, xTitle, yTitle ); }
/// <summary> /// Updates the given chart with the given column data. /// </summary> /// <param name="chart">A chart.</param> /// <param name="y">The y values.</param> /// <param name="xUnits">The units for the x-axis.</param> /// <remarks> /// Titles are added only if chart does not currently contain any titles. /// <br/> /// chart.Series[0] is replaced, or added if necessary. /// </remarks> public static void Update( ref ChartControl chart, DFIntColumn y, Unit xUnits ) { string title = "DFIntColumn"; string xTitle = xUnits.Name; string yTitle = "Value"; ChartSeries series = BindXY( xUnits.ToDoubleVector( y.Count ), y, ChartSeriesType.Line, ChartSymbolShape.None ); Update( ref chart, series, title, xTitle, yTitle ); }
/// <summary> /// Updates the given chart with the given column data. /// </summary> /// <param name="chart">A chart.</param> /// <param name="y">The y values.</param> /// <remarks> /// Titles are added only if chart does not currently contain any titles. /// <br/> /// chart.Series[0] is replaced, or added if necessary. /// </remarks> public static void Update( ref ChartControl chart, DFIntColumn y ) { Update( ref chart, y, new Unit() ); }