在graphael图表中更改轴线颜色

时间:2013-12-15 21:43:20

标签: charts graphael

请考虑以下代码(抱歉,我无法将其放在jsfiddle上):

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script src="raphael.js"></script>
<script src="g.raphael.js"></script>
<script src="g.bar.js"></script>
<script src="g.line-min.js"></script>
<body>
<div style="width:500px;height:150px" id="div"></div>
<script>
            var r = Raphael("div",400,150),
                    fin = function () {
                        this.flag = r.popup(this.x, this.y, this.value || "0").insertBefore(this).attr([{fill: "#bbbbbb"}]); 
                    },
                    fout = function () {
                        this.flag.animate({opacity: 0}, 300, function () {this.remove();});
                    },
                    txtattr = { font: "12px sans-serif" };
            var rr=r.linechart(0, 0, 400, 125, [0,1,2,3,4],[250,200,350,100,300], {axis: '0 0 1 0',axisxstep:4,symbol:'circle',width:1}).hoverColumn(fin, fout);
            rr.axis[0].attr([{fill: "#bbbbbb"}]);
</script>
</body> 

我想将x轴线颜色从黑色更改为灰色。我该怎么办?

1 个答案:

答案 0 :(得分:2)

你在这里:

rr.axis[0].attr([{stroke: '#ccc', fill: "#bbbbbb"}]);

http://jsfiddle.net/saxxi/GDCT5/1/