Stacked barchart How to..

2 posts, 0 answers
  1. Andy Green
    Andy Green avatar
    376 posts
    Member since:
    Aug 2008

    Posted 24 Aug 2017 Link to this post


    I have a dataset containing the following data items

    Location, Capacity & utilisation.

    What I'm trying to do is have Location down the y Axis and show a stacked bar on the X with Capacity always at 100% and the utilisation shown over it with the actual data value shown as a % next to the bar.

    I have gone through the help and docs but cant get what I need to show,  For example where is the DataPointValue in 2017 Barchart?


  2. Ivan Hristov
    Ivan Hristov avatar
    236 posts

    Posted 28 Aug 2017 Link to this post

    Hi Andy,

    If we correctly understand your requirement, you need stacked bar chart with two series - first (Capacity) is static and always peaks 100% and the second one (Utilisation) obtains its value from a data source and shows it as a part of the Capacity bar, presenting the ratio between them.

    This can easily be done with series that have their ArrangeMode set to Stacked100. In your case the datasource can be simplified to only two fields - Location and Utilisation, since Capacity is always 100.
    However, in Stacked100 mode the engine will calculate the ratio between the sum of the values of both series, so we need to adjust the X value of the Capacity series, filling it up to 100% with the following expression:
    = 100 - Sum(Fields.Utilisation)

    Please take a look at the attached screenshot and example report that demonstrate the layout described above.

    We're always trying to keep our documentation up to date with our current release, so we'll appreciate it if you tell us which articles are obsolete and/or unclear, so we can improve it.
    Our Graph item doesn't have class or property named DataPointValue. The data points are produced by GraphSeries instances and they provide simple coordinate properties like X/X0 and Y/Y0 to represent the current data point position.

    If you have further questions, please do not hesitate to ask.

    Ivan Hristov
    Progress Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top