protected void Page_Load(object sender, System.EventArgs e)
{
if (IsPostBack) return;
// セルにデータを設定します。
FarPoint.Web.Spread.SheetView sv = FpSpread1.Sheets[0];
sv.RowCount = 10;
sv.ColumnCount = 10;
sv.Cells[0, 0].Value = 2;
sv.Cells[0, 1].Value = 5;
sv.Cells[0, 2].Value = 4;
sv.Cells[0, 3].Value = -1;
sv.Cells[0, 4].Value = 3;
sv.Cells[1, 0].Value = 3;
sv.Cells[1, 1].Value = 1;
sv.Cells[1, 2].Value = 2;
sv.Cells[1, 3].Value = -1;
sv.Cells[1, 4].Value = 5;
sv.Cells[2, 0].Value = 3;
sv.Cells[2, 1].Value = 10;
sv.Cells[2, 2].Value = 2;
sv.Cells[2, 3].Value = -1;
sv.Cells[2, 4].Value = 5;
// 1つ目のスパークラインを作成します。
FarPoint.Web.Spread.Model.CellRange location1 = new FarPoint.Web.Spread.Model.CellRange(0, 0, 1, 5);
FarPoint.Web.Spread.ExcelSparkline es1 = new FarPoint.Web.Spread.ExcelSparkline(0, 5, sv, location1);
// 2つ目のスパークラインを作成します。
FarPoint.Web.Spread.Model.CellRange location2 = new FarPoint.Web.Spread.Model.CellRange(1, 0, 1, 5);
FarPoint.Web.Spread.ExcelSparkline es2 = new FarPoint.Web.Spread.ExcelSparkline(1, 5, sv, location2);
// 3つ目のスパークラインを作成します。
FarPoint.Web.Spread.Model.CellRange location3 = new FarPoint.Web.Spread.Model.CellRange(2, 0, 1, 5);
FarPoint.Web.Spread.ExcelSparkline es3 = new FarPoint.Web.Spread.ExcelSparkline(2, 5, sv, location3);
// スパークラインのデータ点、マーカーの設定をします。
FarPoint.Web.Spread.ExcelSparklineSetting ex = new FarPoint.Web.Spread.ExcelSparklineSetting();
ex.ShowFirst = true;
ex.FirstMarkerColor = Color.Violet;
// グループを作成し、スパークラインを追加します。
FarPoint.Web.Spread.ExcelSparklineGroup esg = new FarPoint.Web.Spread.ExcelSparklineGroup(ex, SparklineType.Column);
esg.Add(es1);
esg.Add(es2);
esg.Add(es3);
// シートにスパークライングループを追加します。
sv.SparklineContainer.Add(esg);
}
protected void Button1_Click(object sender, EventArgs e)
{
// グループを再設定し、スパークラインの種類、軸の表示、マーカー色を変更します。
FarPoint.Web.Spread.ExcelSparklineGroup esg = FpSpread1.Sheets[0].GroupSparkline(new FarPoint.Web.Spread.Model.CellRange[] { new FarPoint.Web.Spread.Model.CellRange(1, 5, 3, 1) }, FarPoint.Web.Spread.SparklineType.Line);
ExcelSparklineSetting es = new ExcelSparklineSetting();
es.DisplayXAxis = true;
es.SeriesColor = Color.Orange;
esg.Setting = es;
}
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
If IsPostBack Then Return
' セルにデータを設定します。
Dim sv As FarPoint.Web.Spread.SheetView = FpSpread1.Sheets(0)
sv.RowCount = 10
sv.ColumnCount = 10
sv.Cells(0, 0).Value = 2
sv.Cells(0, 1).Value = 5
sv.Cells(0, 2).Value = 4
sv.Cells(0, 3).Value = -1
sv.Cells(0, 4).Value = 3
sv.Cells(1, 0).Value = 3
sv.Cells(1, 1).Value = 1
sv.Cells(1, 2).Value = 2
sv.Cells(1, 3).Value = -1
sv.Cells(1, 4).Value = 5
sv.Cells(2, 0).Value = 3
sv.Cells(2, 1).Value = 1
sv.Cells(2, 2).Value = 2
sv.Cells(2, 3).Value = -1
sv.Cells(2, 4).Value = 5
' 1つ目のスパークラインを作成します。
Dim location1 As New FarPoint.Web.Spread.Model.CellRange(0, 0, 1, 5)
Dim es1 As New FarPoint.Web.Spread.ExcelSparkline(0, 5, sv, location1)
' 2つ目のスパークラインを作成します。
Dim location2 As New FarPoint.Web.Spread.Model.CellRange(1, 0, 1, 5)
Dim es2 As New FarPoint.Web.Spread.ExcelSparkline(1, 5, sv, location2)
' 3つ目のスパークラインを作成します。
Dim location3 As New FarPoint.Web.Spread.Model.CellRange(2, 0, 1, 5)
Dim es3 As New FarPoint.Web.Spread.ExcelSparkline(2, 5, sv, location3)
' スパークラインのデータ点、マーカーの設定をします。
Dim ex As New FarPoint.Web.Spread.ExcelSparklineSetting()
ex.ShowFirst = True
ex.FirstMarkerColor = Color.Violet
' グループを作成し、スパークラインを追加します。
Dim esg As New FarPoint.Web.Spread.ExcelSparklineGroup(ex, SparklineType.Column)
esg.Add(es1)
esg.Add(es2)
esg.Add(es3)
' シートにスパークライングループを追加します。
sv.SparklineContainer.Add(esg)
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs)
' グループを再設定し、スパークラインの種類、軸の表示、マーカー色を変更します。
Dim esg As FarPoint.Web.Spread.ExcelSparklineGroup = FpSpread1.Sheets(0).GroupSparkline(new FarPoint.Web.Spread.Model.CellRange() { New FarPoint.Web.Spread.Model.CellRange(1, 5, 3, 1) }, FarPoint.Web.Spread.SparklineType.Line)
Dim es As New FarPoint.Web.Spread.ExcelSparklineSetting()
es.DisplayXAxis = True
es.SeriesColor = Color.Orange
esg.Setting = es
End Sub