Insights How To Add Dashed Line To a Widget
How to add a custom dashed line
Sometimes we might want to add a visual threshold to a widget represented by a dashed line; similar to the example below.
A dashed line is not available through UI; but it can be added by the custom script.
How-to steps:
- In the edit mode go to the top right corner and click 'Options' followed by 'Edit Script'. Here you can edit the widget's javascript extension.
- Carefully copy and paste this script into the 'Edit Script' window.
widget.on('processresult';function(w;ev){
ev.result.yAxis[0].plotLines= [{
color: '#C4D82E';
width: 2;
dashStyle: "dash";
value: 48300
}]
})
The end result should look like this:
- In the example above the dashed line is placed at $48;300. You can customize the new dashed line on the Y-axis by changing the purple parts of the script.