Adding legend for conditional coloring

Answered

Comments

2 comments

  • Avatar
    Lidor Rosencovich

    Hi Alina,

    In order to do so, you can use the following widget script example and apply it to your chart.

    It basically adds 3 more invisible series with a name and a color - the legend will be shown with the same names and colors and you won't see additional series on your chart.

    widget.on('beforeviewloaded', function(sender, ev){ 
    // define your titles and colors to be added to the legend
    var legends = [
    {name:"LAGS STANDARD", color:"#fc7570"},
    {name:"MEETS STANDARD", color: "#00a808"},
    {name:"LEADS STANDARD", color: "#ffff01"}
    ]

    _.each(legends, function(val){
    ev.options.series.push(
    {
    name: val.name,
    color: val.color,
    visible: false
    }
    );
    });
    });

    Regards,

    Lidor

    1
    Comment actions Permalink
  • Avatar
    Pramata Corporation

    Hi Lidor,

     

    Is there a way this script can be used in an Area Map widget?

     

    Thanks

    Mark

    0
    Comment actions Permalink

Please sign in to leave a comment.