subtotals along the horizontal axis in Pivot

Hi!

In Pivot widget, is it possible to visualize subtotals along the horizontal axis?

In your demo (https://webix.com/demos/pivot/) it only shows the hierarchical structure along the vertical axis.

Thanks in advance,
Andrey.

Hello @Andrey26,

In Pivot widget, is it possible to visualize subtotals along the horizontal axis?

By default, it is only possible to display totals for each row via the totalColumn property: Code Snippet.

I am not quite sure how the subtotals would work in this case, as they don’t seem to make much sense - the data within pivot is aggregated following the specified structure. Within the structure configuration object you can set columns, which define the x-scale of the pivot. Following these columns, the data will be aggregated accordingly (i.e. if you specify “year” as a column, every data item with the same value in that field will be grouped together).

For example: Code Snippet.

Notice the initial dataset, the columns set, and the way the data was aggregated using this structure - the value (“oil”) specified in values has been grouped up by years (set in columns) and summed up (this is the default data operation within the pivot, if no other operation has been specified). You can read more about general pivot structure and its usage in the following chapter of our documentation: https://docs.webix.com/pivot__structure.html.

Going back to your original question, considering the explanation above, could you please elaborate on how you would want to display the subtotals given the pivot structure? The only possible use case for this would include a custom pivot structure, with collapsible columns, e.g.: Code Snippet (even then, considering data operations that are present within each column, totaling up these columns doesn’t make much sense).