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

hoverCallback's bug #264

Closed
ghost opened this issue Jul 23, 2013 · 2 comments
Closed

hoverCallback's bug #264

ghost opened this issue Jul 23, 2013 · 2 comments

Comments

@ghost
Copy link

ghost commented Jul 23, 2013

let's say, we use data like "[{date:2013-07-13,value:'node A'},{date:2013-07-12,value:"node B"}]".
Morris will order the nodes again, to show them in right order.

But the for the "hoverCallback" method:

hoverCallback: function (index, options,content) {
var row = options.data[index];

if i choose the second node which's date is 2013-07-13, the index value will be 2, but the "options.data" is still the original data.

@sudodoki
Copy link
Contributor

Okay, so main culprit here is probably, this line
https://github.com/oesmith/morris.js/blob/master/lib/morris.grid.coffee#L182
The question arise: should callback arity be changed or should we modify options.data as well as data?

oesmith added a commit that referenced this issue Nov 9, 2013
Chart data points are sorted when using parseTime, so indices will not
always match the original data ordering.

Also fixes a couple of event triggers.

Ref: #264.
@oesmith
Copy link
Contributor

oesmith commented Nov 9, 2013

Since the indices get all messed up by the sort, I've added an extra parameter to the hover callback. See https://github.com/oesmith/morris.js/blob/master/examples/decimal-custom-hover.html#L182 for an example of the new param.

@oesmith oesmith closed this as completed Jun 14, 2014
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

No branches or pull requests

2 participants