How To Create A Dash Line In Line Chart
As a user sometimes I would like to change the format of one line to a dash line.

To apply the dash file enter the "Edit Script" within the widget editor and insert the script bellow.
Change in the 1st line of the code the "name of value" to the name you gave the formula you wish to change in the widget.
in our case var name = "Number of likes";
Change in the 1st line of the code the "name of value" to the name you gave the formula you wish to change in the widget.
in our case var name = "Number of likes";
var name = "Name of Value";
widget.on("beforeviewloaded", function(w, args){
for (var i = 0 ; i < args.options.series.length; i++){
if (args.options.series[i].name === name){
args.options.series[i].dashStyle = "dash"
}
}
});
To insert more than one variable:
For N variables, you'd need N variables and N for loops:
var series1 = "Total Revenue";
var series2 = "Total Quantity";
var seriesN = "Name of Nth series"
widget.on("beforeviewloaded", function(w, args){
for (var i = 0 ; i < args.options.series.length; i++){
if (args.options.series[i].name === series1){
args.options.series[i].dashStyle = "dash"
}
}
for (var i = 0 ; i < args.options.series.length; i++){
if (args.options.series[i].name === series2){
args.options.series[i].dashStyle = "dash"
}
}
....
for (var i = 0 ; i < args.options.series.length; i++){
if (args.options.series[i].name === seriesN){
args.options.series[i].dashStyle = "dash"
}
}
});
0
Comment actions
Updated 03-02-2023
intapiuser
Admin
Joined December 15, 2022