cancel
Showing results for 
Search instead for 
Did you mean: 
intapiuser
Community Team Member
Community Team Member
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";
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
Rate this article:
Version history
Last update:
‎03-02-2023 09:09 AM
Updated by:
Contributors