For I = 0 To Graph.PlotArea.XAxis.Items.Count - 1 Graph.PlotArea.XAxis.Item(I).Visible = False Next The X labels are visible
What is wrong ?
Thanks
3 Answers, 1 is accepted
0
Ves
Telerik team
answered on 02 Oct 2008, 06:04 AM
Hi,
The code seems to be correct. However it is important that it is executed after the X axis items are created. If the X axis AutoScale property is set to true (this is the default value) the items will not be available before BeforeLayout event. This means that the labels count in this loop will be 0. While you can move the code to BeforeLayout event handler and it will work, there is another simple solution for this problem:
Sorry, but in debug mode I can see that items.count = 742
and autoscale is set to True.
Trying to move my loop in the BeforeLayout event handler doesn't solve it.
Graph.PlotArea.XAxis.Appearance.LabelAppearance.Visible = False will not solve my problem because the code I give you is to resume my problem.
In fact I have a Tables with 2 fields: Date and Values
I have one record for each days.
So I try to find a way to display all the value, but only months on the Xaxis.
In my final code, I test in the loop if
Graph.PlotArea.XAxis.Item(I).TextBlock.Text=
Graph.PlotArea.XAxis.Item(I-1).TextBlock.Text in order to make it visible or not