pokazując wszystkie wartości w kontrolce Xaxis
Mam wykres kilku produktów, w sumie 35. Skalują oś X. Wykres dobrze spisuje się, ale tylko 5 z nazw produktów pokazuje i muszę je pokazać. Włączyłem MinorTickMark do true, więc wszystkie znaczniki pokazują, ale jak mogę uzyskać ich odpowiednią etykietę?
Nie mogłem opublikować obrazu, więc tutaj znajduje się znacznik aspx i kod. znacznik .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>
Oto kod, na którym można umieścić przykładowe dane na wykresie.
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