You can also use this approach for a data bound Pie series as well as other one-dimensional series like Donut and Funnel.įigure 2: Displaying grand total in the legend of Pie series. You can find an image of a declaratively created Pie series that has a grand total label in their legend in Figure 2. Call the newly created JavaScript function on the initial page load as well as on each legend item click.Configures a legend template to display the calculated sum for the newly create Pie item.Iterates through the Pie items and sums their values up in a variable.Create a JavaScript function that does the following:.Add an additional Pie series item in the chart that will have a 0 value and will be used for displaying the grand total. In order to display grand total in the legend of Pie series you can use the following steps: You can also use this approach for other category series that can be stacked (e.g., Bar series).įigure 1: Displaying grand total labels for a data bound stacked series.ĭisplay Grand Total in the Legend of Pie Series You can see how looks a data bound stacked Column series that has a grand total label displayed for each category in Figure 1. Use a template for the labels in the "Grand Total" series in order to calculate the sum of the stacked items over the x-axis categories.Hide the border of the "Grand Total" series, so that there aren't any visual glitches in the chart resulting from the relatively small values of this series.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |