Let's see the steps and sample:
1. Add a chart to the dashboard and select the initial chart type.
2. Add static step with values of chart type, such as Stack Vertical Bar, Stack Horizontal Bar, etc. You need to know the value for each chart type, sample
"values": [
{
"display": "Stack Vertical Bar",
"value": "stackvbar"
},
{
"display": "Stack Horizontal Bar",
"value": "stackhbar"
},
{
"display": "Heatmap",
"value": "heatmap"
},
{
"display": "Line",
"value": "line"
}
]
3. Change columnMap to null, you need to change only columnMap under chart/widget (not the one under the step).
4. Change visualizationType under chart/widget (not the one under the step) to {{coalesce(cell(Chart_Type_1.selection, 0, \"value\"), cell(Chart_Type_1.result, 0, \"value\")).asString()}}
** Chart_Type_1 is the step name for static step
5. For some type of charts, they required additional parameters, you need to add them, otherwise, it will not work. You can monitor the additional parameters when you add a chart with the selected chart type, some of the parameters are required, and some are not required.
all values in parameters below are for samples only
"lowColor": "#E2F4FC",
"highColor": "#009DDF",
"x": {
"showAxis": true,
"showTitle": true,
"title": ""
},
"y": {
"showAxis": true,
"showTitle": true,
"title": ""
}
Horizontal Bar, Vertical Bar, Stack Horizontal Bar, Stack Vertical Bar
"trellis": {
"enable": false,
"showGridLines": true,
"flipLabels": false,
"type": "x",
"chartsPerLine": 4,
"size": [
100,
100
]
},
"showValues": true,
"axisMode": "multi",
"dimensionAxis": {
"showAxis": true,
"showTitle": true,
"title": "",
"customSize": "auto",
"icons": {
"useIcons": false,
"iconProps": {
"column": "",
"fit": "cover",
"type": "round"
}
}
},
"measureAxis1": {
"sqrtScale": false,
"showAxis": true,
"customDomain": {
"showDomain": false
},
"showTitle": true,
"title": ""
},
"measureAxis2": {
"sqrtScale": false,
"showAxis": true,
"customDomain": {
"showDomain": false
},
"showTitle": true,
"title": ""
},
"normalize": false,
"exploreLink": true
Line
"showPoints": false,
"showZero": true,
"drawArea": {
"showDrawArea": false,
"bounding1": "",
"bounding2": "",
"measure": ""
},
"dashLine": {
"showDashLine": false,
"measures": ""
},
"exploreLink": true
Donut
"trellis": {
"enable": false,
"showGridLines": true,
"flipLabels": false,
"type": "x",
"chartsPerLine": 4,
"size": [
100,
100
]
},
"exploreLink": true,
"showMeasureTitle": true,
"centerValueType": "number",
"centerText": "",
"inner": 60
In summary: if your binding contains such chart type, make sure to add all of them to the parameters, especially the required parameters, otherwise, the binding for that chart type will just not working.
No comments:
Post a Comment