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

Chart XAxis DataLabelsColumn display problem

2 Answers 110 Views
Chart (Obsolete)
This is a migrated thread and some comments may be shown as answers.
lekha
Top achievements
Rank 1
lekha asked on 07 Oct 2010, 01:04 PM
Hi all,
I am using radchart(RadControls for ASP.NET AJAX Q1 2010 SP1)
When i set chart datasource XAxis.DataLabelsColumn contains both numeric and text fields.( A,1,2,3,E)
If the numeric fields is more than text feilds the text filds are displaying as 0.and numeric fields are displaying correctly.(0,1,2,3,0)

Wats is the problem.Share ur suggessions its urgent

Thanks In advance
Lekha

2 Answers, 1 is accepted

Sort by
0
FISCAL
Top achievements
Rank 1
answered on 08 Oct 2010, 09:29 AM
Hi,

i'm facing the similar problem.  Following statement doesn't seem to work. I want Days labelled along X-Axis but it replaces each item in Days fields start from 0 :(

Rather than printing 

M, T, W .. it prints 0 1 2 etc 

myChart.Series.Add(chartSeries);
myChart.PlotArea.XAxis.DataLabelsColumn = "Days";


Thanks,
MG
0
Evgenia
Telerik team
answered on 12 Oct 2010, 01:00 PM
Hello,

It seems that RadChart has problem when setting DataLabelsColumn to both strings and numbers.
What I suggest you is a workaround.
Turn off AutoScale property:
Copy Code
RadChart1.PlotArea.XAxis.AutoScale = false;

Then you can subscribe to BeforeLayout event of the chart and set custom value to every Axis Item. Here is how you can achieve this:

protected void RadChart1_BeforeLayout(object sender, EventArgs e) 
    
        string[] someText = new string[] { "label1", "label2", "label3" }; 
        for (int i = 0; i < someText.Length; i++) 
        
            RadChart1.PlotArea.XAxis.Items[i].TextBlock.Text = someText[i]; 
        
    }

I hope this helps.

Greetings,
Evgenia
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Chart (Obsolete)
Asked by
lekha
Top achievements
Rank 1
Answers by
FISCAL
Top achievements
Rank 1
Evgenia
Telerik team
Share this question
or