g.raphael
g.raphael copied to clipboard
bar chart label method returns an error (with fix)
barchart.label(['Some', 'Label'])
Error: vx * (B || 1) + j is not a object
Fix: replace every v[x * (B || 1) + j] inside the label method with v[j][x]
in the not compressed version you need to replace : "bars[i * (multi || 1) + j]" by "bars[j][i]"
But this fix doesn't work with stacked=false;
@jeremi your code worked very well, I don't understand why it wasn't incorporated inside g.bar.js :(
This resolved the issue for me, as well.
The correct fix is much simpler. The problem is just that two variables were initialized in the wrong order. To fix the minimized version from the unix commandline, do: sed -e 's/(B=q;)(q=0;)/\2\1/' < g.bar-min.js > foo.js && mv foo.js g.bar-min.js
For the uncompressed version, find: multi=len; len=0;
and reverse the order.
I've fixed this in my branch: http://github.com/vezult/g.raphael/commit/8a2b7dc3f97dedf5196791fa9eaa8640350d161a
These suggested fixes did not work correctly for me. I've just committed some fixes that improve the label for both vertical and horizontal bars, with stacked and non-stacked options.
See: http://github.com/glittle/g.raphael/commit/b7054272e5165dfc19cb44c395dec4740cb80f34
I can't make the label to work since my chart displays 12 columns and each of these columns have 4 columns. I wanted to display a 12 months charts, and for each month, the number of x, the number of y etc...
Hi,
I'm afraid none of the fixes proposed above work for me. I get the following error:
"Uncaught TypeError: Object #<R> has no method 'labelise': g.bar.js line 300"
I get the same error, not sure if this is maintained
Hi, any progress or solution to this issue?
There is a limit that only 10 bars/sectors can be displayed using g.raphael