Search code examples
raphaelgraphael

JavaScript- drawing line chart with gRaphael


I'd like to draw a line chart with gRaphael, like the one in the lower right corner: http://g.raphaeljs.com/linechart.html

Now I'd like to change the color of the axis, but I could not find any example how to do that. Here are some examples of how to manipulate the chart, but not how to change the axis color.

Does anyone of you know how to do that?

Thanks in advance,

enne


Solution

  • In part from here, the following Javascript will change the fill color for your axes:

     $.each(chart.axis[0].text.items, function(i, label) {
       label.attr({'fill': '#D6D6D6'});
     });
    
     $.each(chart.axis[1].text.items, function(i, label) {
       label.attr({'fill': '#D6D6D6'});
     });
    

    Enjoy!