Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for labeling bar graphs #71

Closed
wants to merge 4 commits into from
Closed

Fix for labeling bar graphs #71

wants to merge 4 commits into from

Conversation

vezult
Copy link

@vezult vezult commented Sep 23, 2010

This branch contains a fix for #11.

The bug is that we get a crash when attempting to label bar graphs:

Uncaught exception: TypeError: Cannot convert 'v[x*(B||1)+s]' to object

Error thrown at line 7, column 3997 in (y, S) in http://localhost:8000/media/js/g.bar-min.js:
    T=c.g.text(v[x*(B||1)+s].x,S?A+d-g/2:v[x*(B||1)+s].y-10,U).insertBefore(e[x*(B||1)+s]);
called from line 19, column 6 in () in http://localhost:8000/blog/:
    chart.label(labels);
called from line 26, column 212 in () in http://localhost:8000/media/js/jquery-1.4.1.min.js:
    a.call(r,c);
called via Function.prototype.call() from line 33, column 9 in () in http://localhost:8000/media/js/jquery-1.4.1.min.js:
    c.ready()

The problem was simply that a set of variable assignments were misordered:
multi = len;
len = 0;

I've fixed both g.bar.js and g.bar-min.js

@glittle
Copy link

glittle commented Sep 25, 2010

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

@karolk
Copy link
Collaborator

karolk commented Mar 13, 2013

Not compatible with new g.raphael.

@karolk karolk closed this Mar 13, 2013
@boddhisattva
Copy link

@karolk Is there a fix for labeling available with the new g.raphael for bar graphs ? There's a similar issue that is opened here but it doesn't look like we have a work around for it yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants