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

Can ChartView categories with the same name be treated as different categories?

1 Answer 46 Views
ChartView
This is a migrated thread and some comments may be shown as answers.
Asti
Top achievements
Rank 1
Asti asked on 22 Nov 2012, 12:16 PM
Hi, this might sound like a strange question but

If I have a CartesianChart bound to the following sample data:

category (DateTime): 01.01.2000 value 1
category (DateTime): 01.01.2000 value 2

this data is bound to a barseries and the categorybinding and valuebinding are set to the respective fields,
the horizontal x axis contains a DateTimeCategoriesAxis.

When i run this two bars are together and one category is shown which is kind of logical in the sense that it's the same category.

Is there however some way of forcing the x-axis to treat each category as a separate category instead? so that the two bars have spacing between them and are in their respective "category" similar to how Excel does things.

1 Answer, 1 is accepted

Sort by
0
Petar Marchev
Telerik team
answered on 23 Nov 2012, 08:57 AM
Hi Asti,

I suggest that you define a GenericDataPointBinding for the CategoryBinding. You can use it to return a different value (different category) for each item (based on some custom logic). Later you can use the LabelFormat of the axis to make ti look as if the categories are the same. I have attached a simple app demonstrating this. Let us know how it goes. 

Regards,
Petar Marchev
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
ChartView
Asked by
Asti
Top achievements
Rank 1
Answers by
Petar Marchev
Telerik team
Share this question
or