C1WebChart3D で行及び列ラベルを明示的に設定するには、以下のコードを使用します。
Visual Basic コードの書き方
Visual Basic |
コードのコピー
|
---|---|
Dim sg As C1.Win.C1Chart3D.Chart3DDataSetGrid = C1WebChart3D1.ChartGroups(0).ChartData.SetGrid Dim i As Integer Dim months As String() = {"Jan", "Feb", "Mar", "Apr", "May", "Jun", _ "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"} For i = 0 To months.Length - 1 C1WebChart3D1.ChartGroups.RowLabels.Add(i, months(i)) Next i For i = 0 To sg.ColumnCount ' 列のラベルを設定するには、任意のコードを使用してください。 C1WebChart3D1.ChartGroups.ColumnLabels.Add(i, "Col " + i.ToString()) Next i C1WebChart3D1.ChartArea.AxisX.AnnoMethod = C1.Win.C1Chart3D.AnnotationMethodEnum.DataLabels C1WebChart3D1.ChartArea.AxisX.AnnoRotated = True C1WebChart3D1.ChartArea.AxisY.AnnoMethod = C1.Win.C1Chart3D.AnnotationMethodEnum.DataLabels C1WebChart3D1.ChartArea.AxisY.AnnoRotated = True |
C# コードの書き方
C# |
コードのコピー
|
---|---|
C1.Win.C1Chart3D.Chart3DDataSetGrid sg = C1WebChart3D1.ChartGroups(0).ChartData.SetGrid; int i = 0; string[] months = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" }; for (i = 0; i <= months.Length - 1; i++) { C1WebChart3D1.ChartGroups.RowLabels.Add(i, months(i)); } for (i = 0; i <= sg.ColumnCount; i++) { // 列のラベルを設定するには、任意のコードを使用してください。 C1WebChart3D1.ChartGroups.ColumnLabels.Add(i, "Col " + i.ToString()); } C1WebChart3D1.ChartArea.AxisX.AnnoMethod = C1.Win.C1Chart3D.AnnotationMethodEnum.DataLabels; C1WebChart3D1.ChartArea.AxisX.AnnoRotated = true; C1WebChart3D1.ChartArea.AxisY.AnnoMethod = C1.Win.C1Chart3D.AnnotationMethodEnum.DataLabels; C1WebChart3D1.ChartArea.AxisY.AnnoRotated = true; |