But can we make the breakpoints and max numbers to be dynamic? Yes, we can use binding to make those numbers dynamic. There are 4 points can be configured:
- min: usually this is 0
- medium: usually this is X% of max
- high: usually this is Y% of max
- max: usually this is the target
Step-1. Prepare Breakpoints
Use a compare table to prepare the medium, high, and max numbers. For my use case, I'll query to get the max number from a dataset, then calculate medium = 60% of max, and high = 90% of max as breakpoints.
Clip the lens (compare table) to the dashboard, let's name it "breakpoints", then drag it to the dashboard temporarily, we will display the numbers temporary to make sure the numbers are correct. Note down the query name created, this will be used for "Step-3" below.
Step-2. Add Gauge Chart
Drag a gauge chart, select the dataset and value for the needle, and add filters (if necessary).
Step-3. Bind Breakpoints defined into Gauge chart
Note down the Widget Id (not Query Id), switch to dashboard JSON mode, looks for max, high and medium parameters.
Note down the Widget Id (not Query Id), switch to dashboard JSON mode, looks for max, high and medium parameters.
Update the value with result binding, use the step created in "Step-1".
"medium": "{{cell(breakpoints.result,0,\"Medium\").asString()}}"
"high": "{{cell(breakpoints.result,0,\"High\").asString()}}"
"max": "{{cell(breakpoints.result,0,\"Max\").asString()}}"
* Medium, High, Max in the column name in "Step-1".
Step-4. Remove Conditional Formatting
Still in dashboard JSON, at the chart parameter, look for applyConditionalFormatting, and change this to false, by default this is true.
Step-5. Done
Here is the result
Reference: How to Make the Gauge Chart Dynamic Again
Hi I have multiple Gauge charts grouped by Name, each having its own target amount in the compare table, is it possible to apply targets from the table to multiple Gauge charts?
ReplyDeleteSo for example, person A that has a target of 10 and person B that has a target of 5, can their individual gauges show this when they are grouped by name?
unfortunately I am not sure if that possible, please ask in TCRM community.
DeleteI did this very carefully and did not acheive the result...what am I missing?
ReplyDeletecan you try with static value, without binding?
Delete