Binding Stack Graph

5 posts, 0 answers
  1. Adrian
    Adrian avatar
    4 posts
    Member since:
    Mar 2014

    Posted 30 Mar 2014 Link to this post

    I'm trying to create a stack bar graph either in code or in data binding which will bind to my data collection.

    Data Collection is a list (of question)  with question containing correct, incorrect and skipped totals.

    I can't seem to find a good example - any assistance would be great.

  2. Ivaylo Gergov
    Admin
    Ivaylo Gergov avatar
    661 posts

    Posted 02 Apr 2014 Link to this post

    Hi,

    To achieve this you can create two or more BarSeries(with BarSeries.CombineMode set to Stack), bind their ItemsSource to the property that hold the collection of objects and map the Category and the Value of each point to the properties that hold this information through the CategoryBinding and ValueBinding properties. For your convenience I have attached a project that demonstrates this scenario.

    Let me know if this works for you.

    Regards,
    Ivaylo Gergov
    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. DevCraft banner
  4. Adrian
    Adrian avatar
    4 posts
    Member since:
    Mar 2014

    Posted 03 Apr 2014 Link to this post

    Got that working - I'm now trying to set the height of the bars (ultimately the graph) to the a much smaller height.  Its a single stacked bar chart so I really don't need a lot of labels and want the height to be much smaller than its showing at the moment.

    Attached file shows I can display 4 items but want to reduce size of bar chart to show 8-10 items.
  5. Ivaylo Gergov
    Admin
    Ivaylo Gergov avatar
    661 posts

    Posted 04 Apr 2014 Link to this post

    Hi,

    You can control the number of labels through the LinearAxis.LabelInterval property. Also, to make the chart smaller you can change the RadCartesianChart.Height and RadCartesianChart.Width properties. Note, that by default the RadCartesianChart.MinWidth and RadCartesianChart.MinHeight are 100, so if you need smaller values you can change them.

    Regards,
    Ivaylo Gergov
    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.

     
  6. Adrian
    Adrian avatar
    4 posts
    Member since:
    Mar 2014

    Posted 04 Apr 2014 in reply to Ivaylo Gergov Link to this post

    Thanks, I think the MinHeight and Width wee the ones which were causing me the problems.
Back to Top
DevCraft banner