Spread for ASP.NET 7.0 Product Documentation
CanChangeSeriesType Method
See Also  Example Support Options
FarPoint.Web.Spread Assembly > FarPoint.Web.Spread.Chart Namespace > SpreadChart Class : CanChangeSeriesType Method


sourceSeries
The source series.

Glossary Item Box

Determines whether this instance can change the series type of the specified source series.

Syntax

Visual Basic (Declaration) 
Public Function CanChangeSeriesType( _
   ByVal sourceSeries As Series _
) As Boolean
Visual Basic (Usage)Copy Code
Dim instance As SpreadChart
Dim sourceSeries As Series
Dim value As Boolean
 
value = instance.CanChangeSeriesType(sourceSeries)
C# 
public bool CanChangeSeriesType( 
   Series sourceSeries
)

Parameters

sourceSeries
The source series.

Return Value

true if this instance can change the series type to the specified source series; otherwise, false.

Example

This example uses the CanChangeSeries method.
C#Copy Code
FpSpread1.Sheets[0].RowCount = 10;
FpSpread1.Sheets[0].ColumnCount = 10;
FpSpread1.Sheets[0].Cells[0, 1].Value = "c1";
FpSpread1.Sheets[0].Cells[0, 2].Value = "c2";
FpSpread1.Sheets[0].Cells[0, 3].Value = "c3";
FpSpread1.Sheets[0].Cells[1, 0].Value = "s1";
FpSpread1.Sheets[0].Cells[2, 0].Value = "s2";
FpSpread1.Sheets[0].Cells[3, 0].Value = "s3";
FpSpread1.Sheets[0].Cells[4, 0].Value = "s4";
FpSpread1.Sheets[0].Cells[5, 0].Value = "s5";
FpSpread1.Sheets[0].Cells[6, 0].Value = "s6";

FpSpread1.Sheets[0].Cells[1, 1].Value = 1;
FpSpread1.Sheets[0].Cells[2, 1].Value = 2;
FpSpread1.Sheets[0].Cells[3, 1].Value = 3;
FpSpread1.Sheets[0].Cells[4, 1].Value = 4;
FpSpread1.Sheets[0].Cells[5, 1].Value = 5;
FpSpread1.Sheets[0].Cells[6, 1].Value = 6;

FpSpread1.Sheets[0].Cells[1, 2].Value = 7;
FpSpread1.Sheets[0].Cells[2, 2].Value = 8;
FpSpread1.Sheets[0].Cells[3, 2].Value = 9;
FpSpread1.Sheets[0].Cells[4, 2].Value = 10;
FpSpread1.Sheets[0].Cells[5, 2].Value = 11;
FpSpread1.Sheets[0].Cells[6, 2].Value = 12;

FpSpread1.Sheets[0].Cells[1, 3].Value = 13;
FpSpread1.Sheets[0].Cells[2, 3].Value = 14;
FpSpread1.Sheets[0].Cells[3, 3].Value = 15;
FpSpread1.Sheets[0].Cells[4, 3].Value = 16;
FpSpread1.Sheets[0].Cells[5, 3].Value = 17;
FpSpread1.Sheets[0].Cells[6, 3].Value = 18;

FarPoint.Web.Spread.Model.CellRange range = new FarPoint.Web.Spread.Model.CellRange(1, 1, 1, 3);
FpSpread1.Sheets[0].AddChart(range, typeof(FarPoint.Web.Chart.BarSeries), 200, 200, 300, 0, FarPoint.Web.Chart.ChartViewType.View3D, false);
FarPoint.Web.Spread.Model.CellRange range1 = new FarPoint.Web.Spread.Model.CellRange(2, 1, 1, 3);
FpSpread1.Sheets[0].AddChart(range1, typeof(FarPoint.Web.Chart.LineSeries), 200, 200, 300, 200, FarPoint.Web.Chart.ChartViewType.View3D, false);

protected void Button1_Click(object sender, EventArgs e)
    {
FarPoint.Web.Spread.Chart.SpreadChart sourceChart = FpSpread1.Sheets[0].Charts[0];
FarPoint.Web.Chart.ChartModel targetModel = FpSpread1.Sheets[0].Charts[1].Model;
sourceChart.ChangeChartType(targetModel);
//uncomment this and comment the above to change the series type
//FarPoint.Web.Spread.Chart.SpreadChart sourceChart = FpSpread1.Sheets[0].Charts[0];
//FarPoint.Web.Chart.Series sourceSeries = FpSpread1.Sheets[0].Charts[0].Model.PlotAreas[0].Series[0];
//FarPoint.Web.Chart.Series targetSeries = FpSpread1.Sheets[0].Charts[1].Model.PlotAreas[0].Series[0];
//listBox1.Items.Add(sourceChart.CanChangeSeriesType(sourceSeries));
//sourceChart.ChangeSeriesType(sourceSeries, targetSeries);
    }
Visual BasicCopy Code
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
FpSpread1.Sheets(0).RowCount = 10
FpSpread1.Sheets(0).ColumnCount = 10
FpSpread1.Sheets(0).Cells(0, 1).Value = "c1"
FpSpread1.Sheets(0).Cells(0, 2).Value = "c2"
FpSpread1.Sheets(0).Cells(0, 3).Value = "c3"
FpSpread1.Sheets(0).Cells(1, 0).Value = "s1"
FpSpread1.Sheets(0).Cells(2, 0).Value = "s2"
FpSpread1.Sheets(0).Cells(3, 0).Value = "s3"
FpSpread1.Sheets(0).Cells(4, 0).Value = "s4"
FpSpread1.Sheets(0).Cells(5, 0).Value = "s5"
FpSpread1.Sheets(0).Cells(6, 0).Value = "s6"

FpSpread1.Sheets(0).Cells(1, 1).Value = 1
FpSpread1.Sheets(0).Cells(2, 1).Value = 2
FpSpread1.Sheets(0).Cells(3, 1).Value = 3
FpSpread1.Sheets(0).Cells(4, 1).Value = 4
FpSpread1.Sheets(0).Cells(5, 1).Value = 5
FpSpread1.Sheets(0).Cells(6, 1).Value = 6

FpSpread1.Sheets(0).Cells(1, 2).Value = 7
FpSpread1.Sheets(0).Cells(2, 2).Value = 8
FpSpread1.Sheets(0).Cells(3, 2).Value = 9
FpSpread1.Sheets(0).Cells(4, 2).Value = 10
FpSpread1.Sheets(0).Cells(5, 2).Value = 11
FpSpread1.Sheets(0).Cells(6, 2).Value = 12

FpSpread1.Sheets(0).Cells(1, 3).Value = 13
FpSpread1.Sheets(0).Cells(2, 3).Value = 14
FpSpread1.Sheets(0).Cells(3, 3).Value = 15
FpSpread1.Sheets(0).Cells(4, 3).Value = 16
FpSpread1.Sheets(0).Cells(5, 3).Value = 17
FpSpread1.Sheets(0).Cells(6, 3).Value = 18

Dim range As New FarPoint.Web.Spread.Model.CellRange(1, 1, 1, 3)
FpSpread1.Sheets(0).AddChart(range, GetType(FarPoint.Web.Chart.BarSeries), 200, 200, 300, 0, FarPoint.Web.Chart.ChartViewType.View3D, False)
Dim range1 As New FarPoint.Web.Spread.Model.CellRange(2, 1, 1, 3)
FpSpread1.Sheets(0).AddChart(range1, GetType(FarPoint.Web.Chart.LineSeries), 200, 200, 300, 200, FarPoint.Web.Chart.ChartViewType.View3D, False)
End Sub

Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
'Dim sourceChart As FarPoint.Web.Spread.Chart.SpreadChart
'sourceChart = FpSpread1.Sheets(0).Charts(0)
'Dim targetModel As FarPoint.Web.Chart.ChartModel
'targetModel = FpSpread1.Sheets(0).Charts(1).Model
'sourceChart.ChangeChartType(targetModel)
'uncomment this and comment the above to change the series type
Dim sourceChart As FarPoint.Web.Spread.Chart.SpreadChart
sourceChart = FpSpread1.Sheets(0).Charts(0)
Dim sourceSeries As FarPoint.Web.Chart.Series
Dim targetSeries As FarPoint.Web.Chart.Series
sourceSeries = FpSpread1.Sheets(0).Charts(0).Model.PlotAreas(0).Series(0)
targetSeries = FpSpread1.Sheets(0).Charts(1).Model.PlotAreas(0).Series(0)
ListBox1.Items.Add(sourceChart.CanChangeSeriesType(sourceSeries))
sourceChart.ChangeSeriesType(sourceSeries, targetSeries)
End Sub

Requirements

Target Platforms: Windows 7, Windows 8, Windows Vista, Windows Server 2000, Windows 2000 Professional, Windows XP Professional, Windows NT 4.0 Workstation, SP6, Windows NT 4.0 Server, SP6

See Also

© 2002-2014 ComponentOne, a division of GrapeCity. All Rights Reserved.