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

Databound Chart / X axis labels

3 Answers 75 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Michael Salzlechner
Top achievements
Rank 1
Michael Salzlechner asked on 24 Aug 2010, 04:05 PM
i use the ItemsSource property to bind a chart to an array of data with 2 series. essentially showing multiple columns for different days and each column has data for the two series.

in this case how can i set the x axis labels to the date ?

thanks

Mike

3 Answers, 1 is accepted

Sort by
0
Velin
Telerik team
answered on 27 Aug 2010, 04:07 PM
Hello Michael Salzlechner,

You need set up a categorical chart as shown in this online example.

All the best,
Ryan
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
0
Michael Salzlechner
Top achievements
Rank 1
answered on 28 Aug 2010, 12:39 PM
my question was actually if i already have a predefined datasource that does not include the labels for the columns how can i set the column labels without having them in the datasource ?


0
Velin
Telerik team
answered on 01 Sep 2010, 05:13 PM
Hello Michael Salzlechner,

You can handle the AxisX.RangeChange event and manually set the labels as shown below.However, our recommendation is to use categorical chart.

RadChart1.DefaultView.ChartArea.AxisX.RangeChanged += new EventHandler(AxisX_RangeChanged);
        private void AxisX_RangeChanged(object sender, EventArgs e)
        {
            int i = 0;
            foreach (var item in RadChart1.DefaultView.ChartArea.AxisX.TickPoints)
            {
                item.Label = "Text" + i++;
            }
        }


All the best,
Ryan
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
Asked by
Michael Salzlechner
Top achievements
Rank 1
Answers by
Velin
Telerik team
Michael Salzlechner
Top achievements
Rank 1
Share this question
or