This is a migrated thread and some comments may be shown as answers.

ScrollMode and custom labels

1 Answer 58 Views
Chart (Obsolete)
This is a migrated thread and some comments may be shown as answers.
TheGramix
Top achievements
Rank 2
TheGramix asked on 24 Apr 2009, 06:24 AM
Hi guys,
I am using the radChart with the feature ScrollMode="XOnly" enabled and the Zoom disabled (EnableZoom="false").

I defined the event radChart_BeforeLayout where I would like to change the labels of the XAxis:

for( Int32 x = 0; x < radChart.PlotArea.XAxis.Item.Count; x++ )
{
    radChart.PlotArea.XAxis.Item[x].TextBlock.Text = <my value>;
}

but the labels are always 1 to N and they are also highlighted without the possibility to remove the style and change the labels :o(

I tried to remove the ScrollMode (none) and in that way it works. Where is the error? Could you help me?

I am using the last released version: 2009_Q1_402.

Many thanks in advance!
Dino

1 Answer, 1 is accepted

Sort by
0
Accepted
Giuseppe
Telerik team
answered on 27 Apr 2009, 03:12 PM
Hello TheGramix,

Due to the specifics of the chart rendering in zoom/scroll mode, you will need to perform any modifications on the axis items earlier in the page lifecycle i.e. you will need to disable the XAxis.AutoScale mechanism, add the axis items manually and modify them as appropriate in the Page_Load method like this (you need to create them manually as normally they will not be auto-generated at this stage):

protected void Page_Load(object sender, EventArgs e) 
    radChart.PlotArea.XAxis.AutoScale = false
    radChart.PlotArea.XAxis.AddRange(1, 12, 1); 
 
    for (Int32 x = 0; x < radChart.PlotArea.XAxis.Items.Count; x++) 
    { 
        radChart.PlotArea.XAxis.Items[x].TextBlock.Text = "TEST"
    } 



Best wishes,
Manuel
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Chart (Obsolete)
Asked by
TheGramix
Top achievements
Rank 2
Answers by
Giuseppe
Telerik team
Share this question
or