Search code examples
arearendererrickshaw

Area Renderer (Rickshaw)


I am very new in rickshaw graphics, I have this graph

var graph = new Rickshaw.Graph( {
element: document.getElementById("chart"),
width: 900,
height: 500,
renderer: 'area',
stroke: true,
series: [{
   name : "uno", 
   data : data1
  },
  {
   name : "dos", 
   data : data2
  },
  {
   name : "tres", 
   data :data3
  }
 ]
});

But the data value of the charts appear one above the other, for example if the three "y" values are 1, the first one appears in 1, the second in 2 and the third one in 3.

Im not sure what parameters I have to change in order that the three values appears in 1.


Solution

  • The problem was that i had to define the unstack value to true

    var graph = new Rickshaw.Graph( { element: document.getElementById("chart"), width: 900, height: 500, renderer: 'area', unstack : true, stroke: true, series: [{ name : "uno", data : data1 }, { name : "dos", data : data2 }, { name : "tres", data :data3 } ] });