Need to display Grand Total on top of the Htmlchart stacked bars

14 posts, 0 answers
  1. Moorthy
    Moorthy avatar
    5 posts
    Member since:
    Jan 2013

    Posted 26 Feb 2013 Link to this post

    Hello,

    I need to display Grand Total on top of the Htmlchart stacked bars in addition to each stacked bar item value but i do not know how to do that.

    I tried to use DefaultLabelValue with "#STSUM"  but it is not avilable or i do not know how to use it.

    Can you please help me with this?

    I have attached the screen shot for the same.

    Thanks,
    Dhachina
  2. Danail Vasilev
    Admin
    Danail Vasilev avatar
    1490 posts

    Posted 27 Feb 2013 Link to this post

    Hi Dhachina,

    In the current version of RadControls it is not possible to display the grand total of the stacked Bar/Column Series. However, this effect can be achieved only if your HtmlChart is databound. You can find below two approaches:

    Approach1:
    1. Hide the labels of all Series, except the last one.
    2. Create an additional column in your datasource that sums up other columns which are bound to other Series.
    3. Use the additional column from the datasource to populate labels for the last Series through ClientTemplates.
    4. Set the Position property of the labels of the last Series to OutsideEnd.
    You can find an example in the attached archive:
    • RadHtmlChart_ColumnSeries_Stacked_GrandTotal1.aspx
    • RadHtmlChart_ColumnSeries_Stacked_GrandTotal1.aspx.cs
    You can also have a look at the HtmlChart rendering here.

    Approach2:

    If you want, however, to keep the labels of other Series as well, you can:
    1. Create an additional Series.
    2. Create an additional column in your datasource that is populated with values close to 0 (i.e. 0.001)
    3. Databind the additional column to the new Series.
    4. Create another column in your datasource that sums up other columns which are bound to other Series excluding the column with small values close to 0.
    5. Use this column from the datasource to populate labels for the new Series through ClientTemplates.
    6. Set the Position property of the labels of the new Series to OutsideEnd.

    This approach has two disadvantages:

    • The newly created Series will be slightly visible despite their small values.
    • If your legend is visible the name of the newly created Series will figure there.

    You can find an example in the attached archive:

    • RadHtmlChart_ColumnSeries_Stacked_GrandTotal2.aspx
    • RadHtmlChart_ColumnSeries_Stacked_GrandTotal2.aspx.cs
    You can also have a look at the HtmlChart rendering here.

    All the best,
    Danail Vasilev
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.


  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Moorthy
    Moorthy avatar
    5 posts
    Member since:
    Jan 2013

    Posted 28 Feb 2013 Link to this post


    Thank you so much for the alternate solutions.

    Will this be fixed in next or near future releases?

    Thanks,
    Dhachina
  5. Danail Vasilev
    Admin
    Danail Vasilev avatar
    1490 posts

    Posted 01 Mar 2013 Link to this post

    Hello Dhachina,

    This is not a bug in the control but rather a feature request. Actually you are the first one to ask about it, so if we receive other requests as well, our developers might consider its implementation in the future.

    Kind regards,
    Danail Vasilev
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  6. RBeco
    RBeco avatar
    15 posts
    Member since:
    Apr 2013

    Posted 22 Apr 2013 Link to this post

    Hello,

    We would like this feature as well. We have exactly the same situation where we want to display the grand total of the stacked bar.

    Approach 1 is not feasible because in our case not every stacked bar (a column displaying data for a year) will have data for all the series and setting the visibility of the labels to false for every series but the last, will result in no label if one column doesn't happen to have any data for the last series 

    Approach 2 is not feasible for exactly the disadvantages described here. It will clutter up the chart and possibly confuse the client to have an item in the legend that is not really an item.

    We really hope you can add this.

    Thanks in advance!

  7. Danail Vasilev
    Admin
    Danail Vasilev avatar
    1490 posts

    Posted 24 Apr 2013 Link to this post

    Hi All,

    I have logged this idea as a feature request in our feedback portal here, so that you can monitor, comment or raise its priority by voting on it. If it gets enough votes we might consider its implementation for the future.

    You can also find attached a modified version of one of the examples from my previous posts so that now it handles the described unexpected behaviors. Said shortly I have created an additional series with the following settings:
    • series items are set with insignificantly small values (e.g. 0.001)
    • the name property of the series is not specified, so that it is not visible in the legend
    • the color of the series matches the color of the plot area, so that the series items and the legend of the series are not visible
    • clienttemplates for the labels of this series is used in order to sum up the grand total and display it


    Greetings,
    Danail Vasilev
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
  8. Newton
    Newton avatar
    2 posts
    Member since:
    Feb 2013

    Posted 15 Sep 2014 Link to this post

    Hi,

    How do you do this in server side code?

    Thanks 
  9. Danail Vasilev
    Admin
    Danail Vasilev avatar
    1490 posts

    Posted 16 Sep 2014 Link to this post

    Hello Newton,

    Generally the same property and tag names used for the declarative creation can also be used for the programmatic creation of Telerik UI controls.

    You can find an example of a RadHtmlChart programmatic creation in this online demo.

    Regards,
    Danail Vasilev
    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.

     
  10. Mahmoud
    Mahmoud avatar
    1 posts
    Member since:
    Sep 2014

    Posted 24 Sep 2014 Link to this post

    Hi Danail,
    Actually, we are looking for this feature since a while, appreciate if you can confirm adding it to next release
  11. Danail Vasilev
    Admin
    Danail Vasilev avatar
    1490 posts

    Posted 29 Sep 2014 Link to this post

    Hello Mahmoud,

    Generally we receive many requests about features, improvements and fixes regarding 80+ controls. Considering the fact that it is not physically possible to implement the numerous request for all of the controls we let our clients decide which are the most wanted features by voting on them. 

    Currently, however, this feature has less votes than other ones and therefore it gets a lower priority. If it gets enough votes and then approval from our management it may be implemented for the future.

    For the time being I can suggest that you vote on the feedback item and use the example from the Displaying Grand Total In Stacked Series Labels And Pie Series Legend KB article in order to achieve the desired effect.


    Regards,
    Danail Vasilev
    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.

     
  12. Srinivas
    Srinivas avatar
    2 posts
    Member since:
    Mar 2015

    Posted 09 Apr 2015 Link to this post

    Does any of your recent releases like Q1 2015 have this feature added to the HTML Chart ?
  13. Marin Bratanov
    Admin
    Marin Bratanov avatar
    3596 posts

    Posted 10 Apr 2015 Link to this post

    Hello Srinivas,

    As the feedback portal (http://feedback.telerik.com/Project/108/Feedback/Details/46952-add-grand-total-labels-for-stacked-column-and-bar-series) states - the feature is not yet implemented. Its status is Approved, meaning that we believe it is a good idea, but it is not Completed, which would mean it is already implemented.

    For the time being, you should use the approach from the Knowldege Base article: http://www.telerik.com/support/kb/aspnet-ajax/chart-%28html5%29/details/displaying-grand-total-in-stacked-series-labels-and-pie-series-legend.

    Regards,

    Marin Bratanov
    Telerik
     

    See What's Next in App Development. Register for TelerikNEXT.

     
  14. Licensing
    Licensing avatar
    1 posts
    Member since:
    May 2013

    Posted 07 Jan in reply to Marin Bratanov Link to this post

    Hello,

     Has this feature been implemented?

  15. Marin Bratanov
    Admin
    Marin Bratanov avatar
    3596 posts

    Posted 11 Jan Link to this post

    Hello,

    As the Feedback portal page states—this feature has not been implemented yet.

    Regards,

    Marin Bratanov
    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
UI for ASP.NET Ajax is Ready for VS 2017