为什么我的图表倾斜成这样?
Why is my chart tilted like this?
我不知道为什么我的图表倾斜成这样
这是我用来绘制图表的代码
DrawChart(chart12Month, SeriesChartType.Column, _dt12MonthOrders, "mth", "total")
DrawChart( ch12MonthCusts, SeriesChartType.Bar, _dt12MonthCust, "mth", "cnt")
Private Sub DrawChart(ByRef TheChart As Chart, _
Byval ChartType As SeriesChartType, _
ByVal TheTable As DataTable, _
ByVal XCol As String, _
ByVal YCol As String)
TheChart.Series.Clear()
TheChart.Titles.Clear()
TheChart.ChartAreas(0).BackColor = Color.White
TheChart.ChartAreas(0).AxisX.MajorGrid.LineColor = Color.LightSlateGray
TheChart.ChartAreas(0).Area3DStyle.Enable3D = True
Dim Series1 As Series
For Each dr As DataRow In TheTable.Rows
Series1 = New Series(dr(XCol)) '
Series1.Points.AddXY(dr(XCol).ToString(), dr(YCol).ToString())
TheChart.Series.Add(Series1)
Next
End Sub
我需要它看起来像这样不倾斜
编辑
设计者生成的代码
'
'chart12Month
'
ChartArea1.Name = "ChartArea1"
Me.chart12Month.ChartAreas.Add(ChartArea1)
Me.chart12Month.Dock = System.Windows.Forms.DockStyle.Fill
Legend1.Name = "Legend1"
Me.chart12Month.Legends.Add(Legend1)
Me.chart12Month.Location = New System.Drawing.Point(0, 0)
Me.chart12Month.Name = "chart12Month"
Series1.ChartArea = "ChartArea1"
Series1.Legend = "Legend1"
Series1.Name = "Series1"
Me.chart12Month.Series.Add(Series1)
Me.chart12Month.Size = New System.Drawing.Size(398, 187)
Me.chart12Month.TabIndex = 0
Me.chart12Month.Text = "Chart1"
'
'chartPPN
'
ChartArea2.Name = "ChartArea1"
Me.chartPPN.ChartAreas.Add(ChartArea2)
Me.chartPPN.Dock = System.Windows.Forms.DockStyle.Fill
Legend2.Name = "Legend1"
Me.chartPPN.Legends.Add(Legend2)
Me.chartPPN.Location = New System.Drawing.Point(0, 0)
Me.chartPPN.Name = "ch12MonthCusts"
Series2.ChartArea = "ChartArea1"
Series2.Legend = "Legend1"
Series2.Name = "Series1"
Me.chartPPN.Series.Add(Series2)
Me.chartPPN.Size = New System.Drawing.Size(398, 187)
Me.chartPPN.TabIndex = 0
Me.chartPPN.Text = "Chart1"
尝试使用 .Area3DStyle
的属性,例如 .Inclination
、.Rotation
和 .Perspective
来自定义 3D 方向。
我不知道为什么我的图表倾斜成这样
这是我用来绘制图表的代码
DrawChart(chart12Month, SeriesChartType.Column, _dt12MonthOrders, "mth", "total")
DrawChart( ch12MonthCusts, SeriesChartType.Bar, _dt12MonthCust, "mth", "cnt")
Private Sub DrawChart(ByRef TheChart As Chart, _
Byval ChartType As SeriesChartType, _
ByVal TheTable As DataTable, _
ByVal XCol As String, _
ByVal YCol As String)
TheChart.Series.Clear()
TheChart.Titles.Clear()
TheChart.ChartAreas(0).BackColor = Color.White
TheChart.ChartAreas(0).AxisX.MajorGrid.LineColor = Color.LightSlateGray
TheChart.ChartAreas(0).Area3DStyle.Enable3D = True
Dim Series1 As Series
For Each dr As DataRow In TheTable.Rows
Series1 = New Series(dr(XCol)) '
Series1.Points.AddXY(dr(XCol).ToString(), dr(YCol).ToString())
TheChart.Series.Add(Series1)
Next
End Sub
我需要它看起来像这样不倾斜
编辑
设计者生成的代码
'
'chart12Month
'
ChartArea1.Name = "ChartArea1"
Me.chart12Month.ChartAreas.Add(ChartArea1)
Me.chart12Month.Dock = System.Windows.Forms.DockStyle.Fill
Legend1.Name = "Legend1"
Me.chart12Month.Legends.Add(Legend1)
Me.chart12Month.Location = New System.Drawing.Point(0, 0)
Me.chart12Month.Name = "chart12Month"
Series1.ChartArea = "ChartArea1"
Series1.Legend = "Legend1"
Series1.Name = "Series1"
Me.chart12Month.Series.Add(Series1)
Me.chart12Month.Size = New System.Drawing.Size(398, 187)
Me.chart12Month.TabIndex = 0
Me.chart12Month.Text = "Chart1"
'
'chartPPN
'
ChartArea2.Name = "ChartArea1"
Me.chartPPN.ChartAreas.Add(ChartArea2)
Me.chartPPN.Dock = System.Windows.Forms.DockStyle.Fill
Legend2.Name = "Legend1"
Me.chartPPN.Legends.Add(Legend2)
Me.chartPPN.Location = New System.Drawing.Point(0, 0)
Me.chartPPN.Name = "ch12MonthCusts"
Series2.ChartArea = "ChartArea1"
Series2.Legend = "Legend1"
Series2.Name = "Series1"
Me.chartPPN.Series.Add(Series2)
Me.chartPPN.Size = New System.Drawing.Size(398, 187)
Me.chartPPN.TabIndex = 0
Me.chartPPN.Text = "Chart1"
尝试使用 .Area3DStyle
的属性,例如 .Inclination
、.Rotation
和 .Perspective
来自定义 3D 方向。