我有一个包含35个产品的图表。它们在X轴上进行缩放。图表绘制正常,但只显示了5个产品名称,我需要全部显示。我已将MinorTickMark启用为true,以便显示所有刻度线,但如何使它们各自的标签可见?
由于无法发布图片,这里是aspx标记和后台代码。 .aspx标记:
这是将样本数据放入图表的代码后台。
由于无法发布图片,这里是aspx标记和后台代码。 .aspx标记:
<asp:Chart ID="MonthinYearchart" Width="350px" Height="420px" runat="server">
<Series>
<asp:Series ChartType="Bar" ChartArea="MainChartArea" Name="PnL">
</asp:Series>
</Series>
<ChartAreas>
<asp:ChartArea Name="MainChartArea">
</asp:ChartArea>
</ChartAreas>
</asp:Chart>
这是将样本数据放入图表的代码后台。
Private Sub AllCommodforMonthChart()
Dim cht As Chart = MonthinYearchart
'create the arraylist of data
'this is hardcoded to get chart to work, you will have to
'set up the code to retrieve it from database
Dim list As List(Of String) = GetList("Futures Data")
Const val As Integer = 65
'create all the data points
For i As Integer = 0 To list.Count - 1
cht.Series("PnL").Points.AddXY(list(i), val * i)
Next
cht.Series("PnL").ChartType = SeriesChartType.Bar
cht.ChartAreas("MainChartArea").AxisX.MinorTickMark.Enabled = True
End Sub