Boolean Y Values

4 posts, 0 answers
  1. D Warren
    D Warren avatar
    10 posts
    Member since:
    Jul 2012

    Posted 16 Aug 2011 Link to this post

    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?
  2. Yavor
    Admin
    Yavor avatar
    11 posts

    Posted 19 Aug 2011 Link to this post

    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 >>

  3. UI for WPF is Visual Studio 2017 Ready
  4. D Warren
    D Warren avatar
    10 posts
    Member since:
    Jul 2012

    Posted 19 Aug 2011 Link to this post

    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.
  5. Yavor
    Admin
    Yavor avatar
    11 posts

    Posted 23 Aug 2011 Link to this post

    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 >>

Back to Top