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

Pre-defined Set of XCategory Labels in DataBound Line Chart

1 Answer 33 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Matt
Top achievements
Rank 1
Matt asked on 05 Oct 2011, 04:33 PM
My data is structured such that I have 10 categories that I always want to display on the X axis, regardless of whether there are actually points in the bound collection for each of those 10 categories.  Is it possible to define a collection of categories that I want displayed on the X axis prior to binding to an actual data source?  Then, once the data source is bound, a line can be drawn between the YValues of the points in the categories that are actually present in the chart?

As a simplified example, say I have categories A, B, C, D, and E.  My data has values B=10, D=15, E=12.  I want to display a chart where all 5 categories are listed along the X axis with a line drawn between the B->D->E values.  Is this even possible in a data bound scenario?

1 Answer, 1 is accepted

Sort by
0
Yavor
Telerik team
answered on 10 Oct 2011, 11:20 AM
Hello Matt,

You can use RadChart EmptyPointBehavior for displaying the empty categories. If you add your data with null values for your Y-values, RadChart will display the categories, but not the values. When the data comes you can just update your existing points which will update the line accordingly. I have created a small sample project for you that demonstrates this technique.

Hope this helps!

All the best,
Yavor
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
Chart
Asked by
Matt
Top achievements
Rank 1
Answers by
Yavor
Telerik team
Share this question
or