Spread Windows Forms 13.0 Product Documentation
FarPoint.Win.Spread Assembly / FarPoint.Win.Spread.Chart Namespace / SpreadChart Class / ChangeChartType Method
Example


In This Topic
    ChangeChartType Method
    In This Topic
    Changes the type of the chart.
    Overload List
    OverloadDescription
    Changes the type of the chart.  
    Remarks
    This method can be used to change the type of the chart.
    Example
    This example changes the chart type.
    FarPoint.Win.Spread.Model.CellRange celRange = new FarPoint.Win.Spread.Model.CellRange(0, 0, 2, 2);
    FarPoint.Win.Spread.Model.CellRange celRange1 = new FarPoint.Win.Spread.Model.CellRange(0, 0, 4, 4);
    fpSpread1.Sheets[0].AddChart(celRange, typeof(FarPoint.Win.Chart.BarSeries), 200, 200, 0, 0);
    fpSpread1.Sheets[0].AddChart(celRange1, typeof(FarPoint.Win.Chart.LineSeries), 200, 200, 500, 500);
    FarPoint.Win.Spread.Chart.SpreadChart sourceChart = fpSpread1.Sheets[0].Charts[0];
    FarPoint.Win.Chart.ChartModel targetModel = fpSpread1.Sheets[0].Charts[1].Model;
    sourceChart.ChangeChartType(targetModel);
    Dim celRange As New FarPoint.Win.Spread.Model.CellRange(0, 0, 2, 2)
    Dim celRange1 As New FarPoint.Win.Spread.Model.CellRange(0, 0, 4, 4)
    fpSpread1.Sheets(0).AddChart(celRange, GetType(FarPoint.Win.Chart.BarSeries), 200, 200, 0, 0)
    fpSpread1.Sheets(0).AddChart(celRange1, GetType(FarPoint.Win.Chart.LineSeries), 200, 200, 500, 500)
    Dim sourceChart As New FarPoint.Win.Spread.Chart.SpreadChart
    sourceChart = fpSpread1.Sheets(0).Charts(0)
    Dim targetModel As New FarPoint.Win.Chart.ChartModel
    targetModel = fpSpread1.Sheets(0).Charts(1).Model
    sourceChart.ChangeChartType(targetModel)
    See Also