private void Form1_Load(object sender, System.EventArgs e)
{
// シートにデータを設定
fpSpread1.ActiveSheet.Cells[0, 1].Text = "通勤時間";
fpSpread1.ActiveSheet.SetClip(1, 0, 1, 2, "社員A\t25");
fpSpread1.ActiveSheet.SetClip(2, 0, 1, 2, "社員B\t5");
fpSpread1.ActiveSheet.SetClip(3, 0, 1, 2, "社員C\t30");
fpSpread1.ActiveSheet.SetClip(4, 0, 1, 2, "社員D\t60");
fpSpread1.ActiveSheet.SetClip(5, 0, 1, 2, "社員E\t90");
// セル範囲を設定してヒストグラムチャートを作成します
fpSpread1.ActiveSheet.AddChart(new FarPoint.Win.Spread.Model.CellRange(0, 0, 6, 2), typeof(FarPoint.Win.Chart.HistogramSeries), 250, 200, 200, 30);
FarPoint.Win.Chart.ChartModel model = fpSpread1.ActiveSheet.Charts[0].Model;
// 凡例を表示しない
model.LegendAreas.Clear();
FarPoint.Win.Chart.HistogramSeries s = (FarPoint.Win.Chart.HistogramSeries)model.PlotAreas[0].Series[0];
// ビンの幅を指定
s.BinOption.BinSize = 30;
// 軸の目盛間隔を設定
dynamic yAxes = ((FarPoint.Win.Chart.YPlotArea)model.PlotAreas[0]).YAxes[0];
yAxes.AutoMajorUnit = false;
yAxes.MajorUnit = 1;
}
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
' シートにデータを設定
FpSpread1.ActiveSheet.Cells(0, 1).Text = "通勤時間"
FpSpread1.ActiveSheet.SetClip(1, 0, 1, 2, "社員A" + Chr(9) + "25")
FpSpread1.ActiveSheet.SetClip(2, 0, 1, 2, "社員B" + Chr(9) + "5")
FpSpread1.ActiveSheet.SetClip(3, 0, 1, 2, "社員C" + Chr(9) + "30")
FpSpread1.ActiveSheet.SetClip(4, 0, 1, 2, "社員D" + Chr(9) + "60")
FpSpread1.ActiveSheet.SetClip(5, 0, 1, 2, "社員E" + Chr(9) + "90")
' セル範囲を設定してヒストグラムチャートを作成します
FpSpread1.ActiveSheet.AddChart(New FarPoint.Win.Spread.Model.CellRange(0, 0, 6, 2), GetType(FarPoint.Win.Chart.HistogramSeries), 250, 200, 200, 30)
Dim model As FarPoint.Win.Chart.ChartModel = FpSpread1.ActiveSheet.Charts(0).Model
' 凡例を表示しない
model.LegendAreas.Clear()
Dim s As FarPoint.Win.Chart.HistogramSeries = DirectCast(model.PlotAreas(0).Series(0), FarPoint.Win.Chart.HistogramSeries)
' ビンの幅を指定
s.BinOption.BinSize = 30
' 軸の目盛間隔を設定
Dim yAxes = CType(model.PlotAreas(0), FarPoint.Win.Chart.YPlotArea).YAxes(0)
yAxes.AutoMajorUnit = False
yAxes.MajorUnit = 1
End Sub