-
-
Save Louhike/4554788 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
raph = Raphael([..]); | |
chart = raph.g.linechart([..]); | |
var labels = ["first variable", "second variable", "third variable"]; | |
chart.labels = raph.set(); | |
var x = 15; var h = 5; | |
for( var i = 0; i < labels.length; ++i ) { | |
var clr = chart.lines[i].attr("stroke"); | |
chart.labels.push(raph.set()); | |
chart.labels[i].push(raph.g["disc"](x + 5, h, 5) | |
.attr({fill: clr, stroke: "none"})); | |
chart.labels[i].push(txt = raph.text(x + 20, h, labels[i]) | |
.attr(raph.g.txtattr) | |
.attr({fill: "#000", "text-anchor": "start"})); | |
x += chart.labels[i].getBBox().width * 1.2; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Forked to make corrections so it can work with the new version of gRaphaël.