Legend is not getting right color

29 views
Skip to first unread message

Andrés Puerto

unread,
Jul 8, 2015, 2:18:51 PM7/8/15
to elyc...@googlegroups.com
Hi:

i'm trying to get the respective color with each line but i don´t know why i cannot do this, can somebody help me?

$(function() {


$("#chart").chart({
 template : "line_basic_2",
 tooltips : {
  serie1 : [0,0,0,0],
  serie2 : [0,0,0,0],
   serie3 : [0,0,0,0],
  serie4 : [0,0,0,0]
 },
 values : {

 serie1 : [0,0,0,0],
  serie2 : [0,0,0,0],
   serie3 : [0,0,0,0],
  serie4 : [0,0,0,0]
 },
  legend:["a", "b", "c", "d"],
   
 defaultSeries : {
  fill : true,
  stacked : false,
  highlight : {
   scale : 2
  },
  startAnimation : {
   active : true,
   type : "grow",
   easing : "bounce"
  }
 }
});
});
$.elycharts.templates['line_basic_2'] = {
 type : "line",
 margins : [10, 10, 20, 50],
 defaultSeries : {
  plotProps : {
   "stroke-width" : 4
  },
  dot : true,
  dotProps : {
   stroke : "white",
   "stroke-width" : 2
  }
 },
 series : {
  serie1 : {
   color : "yellow"
  },
  serie2 : {
   color : "red"
  },
 serie3 : {
   color : "green"
  },
 
 serie4 : {
   color : "blue"
  }
 },
 defaultAxis : {
  labels : true
 },
 features : {
  grid : {
   draw : [true, false],
   props : {
    "stroke-dasharray" : "-"
   }
  },
  legend : {
   horizontal : false,
   width : 150,
   height : 50,
   x : 520,
   y : 250,
   dotType : "circle",
   
   dotProps : {
   
   stroke : "white",
    "stroke-width" : 2,
 
  },
   borderProps : {
    opacity : 0.3,
    fill : "#c0c0c0",
    "stroke-width" : 0
   }
  }
 }
}


..




Stefano Bagnara

unread,
Jul 9, 2015, 4:12:16 AM7/9/15
to elyc...@googlegroups.com
Change your legend from array to object notation:
====
legend:{serie1:"a", serie2:"b", serie3:"c", serie4:"d"},
====

I guess there is a bug with the old legend syntax.

Can you please open an issue on the new github repository?

--
Hai ricevuto questo messaggio perché sei iscritto al gruppo "ElyCharts" di Google Gruppi.
Per annullare l'iscrizione a questo gruppo e non ricevere più le sue email, invia un'email a elycharts+...@googlegroups.com.
Per altre opzioni visita https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages