Search code examples
javascriptjquerysvgraphaelgraphael

gRaphael : How to make border color for barchat?


Is there any solution to make border-color for bar chart in g.raphael ?

Here is my script

efficiency.barchart(0, 200, 400, 150, [
    [10, 5, 32, 13, 2, 55, 8]
], {
    vgutter: 0,
    colors: ["#F58A2A"],
        "gutter": "0%"
});

Simply needed black border for left, top and right Like this

enter image description here

http://jsfiddle.net/sweetmaanu/u4qzB/4/


Solution

  • Apply attributes to the bars directly within barchart:

    efficiency.barchart(0, 0, 400, 150, [
      [55, 20, 13, 32, 5, 1, 10]
    ], {
      type: 'soft',
      //vgutter: 5,
      stretch: true,
      colors: ["#F00"],
    }).bars.attr({
      stroke: "#000",
      "stroke-width":1
    });