作成日: 2014/09/26 最終更新日: 2014/09/26
文書種別
技術情報
詳細
製品自体には、矢印付きの折れ線を描画する機能はご用意しておりませんが、.NET FrameworkのPenオブジェクトの機能を利用する方法がございます。
具体的には、C1WebChart.DrawDataSeriesイベントを実装し、折れ線の描画に使用するPenを矢印形キャップ付きのPenオブジェクトで置き換えます。
◆サンプルコード
[VB]
[C#]
具体的には、C1WebChart.DrawDataSeriesイベントを実装し、折れ線の描画に使用するPenを矢印形キャップ付きのPenオブジェクトで置き換えます。
◆サンプルコード
[VB]
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim cds As C1.Win.C1Chart.ChartDataSeriesCollection = C1WebChart1.ChartGroups(0).ChartData.SeriesList
cds(0).SymbolStyle.Shape = C1.Win.C1Chart.SymbolShapeEnum.None
cds(1).SymbolStyle.Shape = C1.Win.C1Chart.SymbolShapeEnum.None
End Sub
Protected Sub C1WebChart1_DrawDataSeries(ByVal sender As Object, ByVal e As C1.Win.C1Chart.DrawDataSeriesEventArgs) Handles C1WebChart1.DrawDataSeries
If e.SeriesIndex = 0 Then
Dim pen0 As New Drawing.Pen(Drawing.Color.Blue, 3)
'規定の矢印形キャップを指定します
pen0.EndCap = Drawing.Drawing2D.LineCap.ArrowAnchor
e.Pen = pen0
ElseIf e.SeriesIndex = 1 Then
Dim pen1 As New Drawing.Pen(Drawing.Color.Red, 3)
'サイズを調整可能な矢印形キャップを指定します
pen1.CustomEndCap = New Drawing.Drawing2D.AdjustableArrowCap(5, 7, True)
e.Pen = pen1
End If
End Sub
Dim cds As C1.Win.C1Chart.ChartDataSeriesCollection = C1WebChart1.ChartGroups(0).ChartData.SeriesList
cds(0).SymbolStyle.Shape = C1.Win.C1Chart.SymbolShapeEnum.None
cds(1).SymbolStyle.Shape = C1.Win.C1Chart.SymbolShapeEnum.None
End Sub
Protected Sub C1WebChart1_DrawDataSeries(ByVal sender As Object, ByVal e As C1.Win.C1Chart.DrawDataSeriesEventArgs) Handles C1WebChart1.DrawDataSeries
If e.SeriesIndex = 0 Then
Dim pen0 As New Drawing.Pen(Drawing.Color.Blue, 3)
'規定の矢印形キャップを指定します
pen0.EndCap = Drawing.Drawing2D.LineCap.ArrowAnchor
e.Pen = pen0
ElseIf e.SeriesIndex = 1 Then
Dim pen1 As New Drawing.Pen(Drawing.Color.Red, 3)
'サイズを調整可能な矢印形キャップを指定します
pen1.CustomEndCap = New Drawing.Drawing2D.AdjustableArrowCap(5, 7, True)
e.Pen = pen1
End If
End Sub
[C#]
protected void Page_Load(object sender, EventArgs e)
{
C1.Win.C1Chart.ChartDataSeriesCollection cds = C1WebChart1.ChartGroups[0].ChartData.SeriesList;
cds[0].SymbolStyle.Shape = C1.Win.C1Chart.SymbolShapeEnum.None;
cds[1].SymbolStyle.Shape = C1.Win.C1Chart.SymbolShapeEnum.None;
}
protected void C1WebChart1_DrawDataSeries(object sender, C1.Win.C1Chart.DrawDataSeriesEventArgs e)
{
if (e.SeriesIndex == 0)
{
System.Drawing.Pen pen0 = new System.Drawing.Pen(System.Drawing.Color.Blue, 3);
//規定の矢印形キャップを指定します
pen0.EndCap = System.Drawing.Drawing2D.LineCap.ArrowAnchor;
e.Pen = pen0;
}
else if (e.SeriesIndex == 1)
{
System.Drawing.Pen pen1 = new System.Drawing.Pen(System.Drawing.Color.Red, 3);
//サイズを調整可能な矢印形キャップを指定します
pen1.CustomEndCap = new System.Drawing.Drawing2D.AdjustableArrowCap(5, 7, true);
e.Pen = pen1;
}
}
{
C1.Win.C1Chart.ChartDataSeriesCollection cds = C1WebChart1.ChartGroups[0].ChartData.SeriesList;
cds[0].SymbolStyle.Shape = C1.Win.C1Chart.SymbolShapeEnum.None;
cds[1].SymbolStyle.Shape = C1.Win.C1Chart.SymbolShapeEnum.None;
}
protected void C1WebChart1_DrawDataSeries(object sender, C1.Win.C1Chart.DrawDataSeriesEventArgs e)
{
if (e.SeriesIndex == 0)
{
System.Drawing.Pen pen0 = new System.Drawing.Pen(System.Drawing.Color.Blue, 3);
//規定の矢印形キャップを指定します
pen0.EndCap = System.Drawing.Drawing2D.LineCap.ArrowAnchor;
e.Pen = pen0;
}
else if (e.SeriesIndex == 1)
{
System.Drawing.Pen pen1 = new System.Drawing.Pen(System.Drawing.Color.Red, 3);
//サイズを調整可能な矢印形キャップを指定します
pen1.CustomEndCap = new System.Drawing.Drawing2D.AdjustableArrowCap(5, 7, true);
e.Pen = pen1;
}
}
旧文書番号
69802