how to make horizontal bar chart with each bar labeled

4 posts, 0 answers
  1. David
    David avatar
    22 posts
    Member since:
    Oct 2012

    Posted 09 Apr 2014 Link to this post

    Hi,

    I'd like to make a simple bar chart like the image I've attached.  It's really very basic bar chart (not sure Telerik's name for this sort of chart) with a single series.  Each of the bars should be labeled with it's value.

    Please point me to any examples or snippets that would help me create it.  I prefer to do as much of it using MVVM as possible.


    Thanks!
  2. Petar Marchev
    Admin
    Petar Marchev avatar
    968 posts

    Posted 10 Apr 2014 Link to this post

    Hi David,

    I suggest you use the new ChartView control rather than the old RadChart.

    You can easily achieve the desired output by simply using a vertical CategoricalAxis, a horizontal LinearAxis and a BarSeries with its ShowLabels property set to true. You can examine our online qsf examples and our sdk samples (the sdk browser will prove very helpful so I suggest you install it). You can also check out this very basic BarSeries example in our documentations.

    Regards,
    Petar Marchev
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. UI for WPF is Visual Studio 2017 Ready
  4. David
    David avatar
    22 posts
    Member since:
    Oct 2012

    Posted 14 Apr 2014 in reply to Petar Marchev Link to this post

    Thanks Petar!  Is there anyway to automatically ensure the labels are visible and don't get cut off?  Currently I have a converter trying to calculate the axis maximum, but this isn't an ideal solution.
  5. Petar Marchev
    Admin
    Petar Marchev avatar
    968 posts

    Posted 15 Apr 2014 Link to this post

    Hello David,

    There are a few ways to go here. One is to plug in a smart labels strategy (see example here). Another way would be to use the series' label definitions to place the label inside the bar. I hope these help.

    Regards,
    Petar Marchev
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
Back to Top