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

Boolean Y Values

3 Answers 99 Views
Chart
This is a migrated thread and some comments may be shown as answers.
D Warren
Top achievements
Rank 1
D Warren asked on 16 Aug 2011, 11:14 PM
I have boolean values being used on the Y Axis and the chart control is converting them to 0 and 1. How do I get it to show "True" and "False" labels instead?

3 Answers, 1 is accepted

Sort by
0
Yavor
Telerik team
answered on 19 Aug 2011, 08:16 AM
Hello D Warren,

The best option in this case would be use categorical values:

http://www.telerik.com/help/silverlight/radchart-features-categorical-charts.html

Another option would be manually access the labels and change their values.
This may look something like this:

void Chart1_LayoutUpdated(object sender, EventArgs e)
        {
            if(Chart1.DefaultView.ChartArea.AxisX.TickPoints.Count>0)
            Chart1.DefaultView.ChartArea.AxisX.TickPoints[0].Label = "customValue";
        }

I hope this informaiton helps.

Greetings,
Yavor
the Telerik team

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

0
D Warren
Top achievements
Rank 1
answered on 19 Aug 2011, 05:07 PM
Hey Yavor,

Thanks for the reply. I was actually asking about putting True and False on the Y axis. But if it isn't possible I'll have to make do with the categories on the X Axis.
0
Yavor
Telerik team
answered on 23 Aug 2011, 08:32 AM
Hi D Warren,

Another option to handle this functionality would be to retemplate the axis, and use a value converter for the value of the labels. In this way, you will be able to use the original data (0s and 1s), and simply convert the values.
I hope this suggestion gets you started properly.

All the best,
Yavor
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

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