on 03-06-2019 8:18 AM
Hi,
I have a data source with 2 dimensions and 1 measure
The need is to use this data source in 2 different charts of type pie.
1st pie chart will show Dimension1 and Measure1 (Dimension2 will not be there at all)
2nd pie chart will show Dimension2 and Measure1 (Dimension1 will not be there at all)
How can we achieve this during execution using script code?
Thank you,
Dimitris
Nor really. The data selection API can be used to select existing data for your chart. It can't be used for anything that requires calculation. If you remove a dimension, it means in many cases that the numbers in existing data cells need to change - and this can't be done with data selection.
However there is usually a way to create two distinct charts from a single data source:
You might still be not happy with the shown charts, as the legends/axis contain something like "Total" or "Sum" - which you might not like. But generally it should work.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If you set "Show Totals" = false, you probably don't see any data, as with the mentioned data selection JSONs, all members do contain total data (from the other, unwanted dimension).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You want to achieve it with chart.setDataSelection() API? This might be possible, depending if the resultset already contains all the data you want to show in the two charts.
First try it out in Designer using the the data selection UI. If it works, just pass the correct data selection JSON to setDataSelection API.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If I use this command then the other chart will change as well. This is something that I don't want.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
92 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.