FlexChart for WinForms
複数のプロット領域
FlexChart > FlexChart の操作 > FlexChart の要素 > 複数のプロット領域

複数のプロット領域を使用すると、一方の軸は固定したまま、もう一方の軸方向には各系列を個別のプロット領域に表示して、データの可視性を向上させることができます。

FlexChart では、1 つのチャート領域内で、系列ごとに異なるプロット領域を作成できます。FlexChart で複数のプロット領域を作成し、それらを FlexChart.PlotAreas コレクションに追加します。さらに、プロット領域の行インデックス、列インデックス、高さ、幅をカスタマイズできます。

次の図に、複数のプロット領域を含む FlexChart を示します。各プロット領域には 1 つの系列のデータが表示されます。

次のコードでは、車の加速度、速度、距離、時間の 4 つのメトリックに関するデータを使用します。このコードは、FlexChart で複数のプロット領域を実装する方法を示します。

' 複数のプロット領域を作成して追加します。
FlexChart1.PlotAreas.Add(New PlotArea() With {
    .Name = "plot1",
    .Row = 0
})
FlexChart1.PlotAreas.Add(New PlotArea() With {
    .Name = "plot2",
    .Row = 2
})
FlexChart1.PlotAreas.Add(New PlotArea() With {
    .Name = "plot3",
    .Row = 4
})

' チャートタイプを指定します。
FlexChart1.ChartType = C1.Chart.ChartType.Area

' 系列を作成、追加およびバインドします。
FlexChart1.Series.Add(New Series() With {
    .Name = "加速",
    .Binding = "Acceleration"
})


FlexChart1.Series.Add(New Series() With {
    .Name = "速度",
    .Binding = "Velocity",
    .AxisY = New Axis() With {
        .Position = C1.Chart.Position.Left,
        .MajorGrid = True,
        .PlotAreaName = "plot2"
    }
})

FlexChart1.Series.Add(New Series() With {
    .Name = "距離",
    .Binding = "Distance",
    .AxisY = New Axis() With {
        .Position = C1.Chart.Position.Left,
        .MajorGrid = True,
        .PlotAreaName = "plot3"
    }
})
// 複数のプロット領域を作成して追加します。
flexChart1.PlotAreas.Add(new PlotArea { Name = "plot1", Row = 0 });
flexChart1.PlotAreas.Add(new PlotArea { Name = "plot2", Row = 2 });
flexChart1.PlotAreas.Add(new PlotArea { Name = "plot3", Row = 4 });

// チャートタイプを指定します。
flexChart1.ChartType = C1.Chart.ChartType.Area;

// 系列を作成、追加およびバインドします。
flexChart1.Series.Add(new Series()
{
    Name = "加速",
    Binding = "Acceleration",

});

flexChart1.Series.Add(new Series()
{
    Name = "速度",
    Binding = "Velocity",
    AxisY = new Axis()
    {
        Position = C1.Chart.Position.Left,
        MajorGrid = true,
        PlotAreaName = "plot2"
    },

});

flexChart1.Series.Add(new Series()
{
    Name = "距離",
    Binding = "Distance",
    AxisY = new Axis()
    {
        Position = C1.Chart.Position.Left,
        MajorGrid = true,
        PlotAreaName = "plot3"
    }
});