private void Form1_Load(object sender, System.EventArgs e)
{
// シートにデータを設定
fpSpread1.ActiveSheet.SetClip(0, 0, 1, 2, "収益\t1200");
fpSpread1.ActiveSheet.SetClip(1, 0, 1, 2, "原価\t-999");
fpSpread1.ActiveSheet.SetClip(2, 0, 1, 2, "粗利益\t201");
fpSpread1.ActiveSheet.SetClip(3, 0, 1, 2, "管理費\t-55");
fpSpread1.ActiveSheet.SetClip(4, 0, 1, 2, "純利益\t146");
// セル範囲を設定してウォーターフォールチャートを作成します
fpSpread1.ActiveSheet.AddChart(new FarPoint.Win.Spread.Model.CellRange(0, 0, 5, 2), typeof(FarPoint.Win.Chart.WaterfallSeries), 300, 200, 150, 30);
FarPoint.Win.Chart.ChartModel model = fpSpread1.ActiveSheet.Charts[0].Model;
// 凡例を上部に表示
model.LegendAreas[0].LegendPos = FarPoint.Win.Chart.LegendPos.Top;
model.LegendAreas[0].Vertical = false;
// 最後の値を合計に設定
FarPoint.Win.Chart.WaterfallSeries s = (FarPoint.Win.Chart.WaterfallSeries)model.PlotAreas[0].Series[0];
s.SetTotal(s.Values.Count - 1, true);
}
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
' シートにデータを設定
FpSpread1.ActiveSheet.SetClip(0, 0, 1, 2, "収益" + Chr(9) + "1200")
FpSpread1.ActiveSheet.SetClip(1, 0, 1, 2, "原価" + Chr(9) + "-999")
FpSpread1.ActiveSheet.SetClip(2, 0, 1, 2, "粗利益" + Chr(9) + "201")
FpSpread1.ActiveSheet.SetClip(3, 0, 1, 2, "管理費" + Chr(9) + "-55")
FpSpread1.ActiveSheet.SetClip(4, 0, 1, 2, "純利益" + Chr(9) + "146")
' セル範囲を設定してウォーターフォールチャートを作成します
FpSpread1.ActiveSheet.AddChart(New FarPoint.Win.Spread.Model.CellRange(0, 0, 5, 2), GetType(FarPoint.Win.Chart.WaterfallSeries), 300, 200, 150, 30)
Dim model As FarPoint.Win.Chart.ChartModel = FpSpread1.ActiveSheet.Charts(0).Model
' 凡例を上部に表示
model.LegendAreas(0).LegendPos = FarPoint.Win.Chart.LegendPos.Top
model.LegendAreas(0).Vertical = False
' 最後の値を合計に設定
Dim s As FarPoint.Win.Chart.WaterfallSeries = DirectCast(model.PlotAreas(0).Series(0), FarPoint.Win.Chart.WaterfallSeries)
s.SetTotal(s.Values.Count - 1, True)
End Sub