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

Tooltips are displayed with the incorrect "columns" #325

Closed
juanlu-sanz opened this issue Jun 5, 2014 · 7 comments
Closed

Tooltips are displayed with the incorrect "columns" #325

juanlu-sanz opened this issue Jun 5, 2014 · 7 comments
Labels
C-bug Category: This is a bug resolved maybe

Comments

@juanlu-sanz
Copy link

Hi!

I was trying to make a line chart from some JSON data and I've noticed that if, for example, one line has three values at columns a, b and c, while another line has only two values at columns a and c,

  • the tooltip hovering column a will be correct
  • the tooltip for point b will show the value of the column b for the first line BUT the value for column c for the second, two point line
  • the tooltip over point only shows the value of the first line at point c

graph

Here the point with 550 height shown in the middle column is actually the point (correctly drawn) in the rightmost column

Is it a bug? or did I do something wrong?

Thanks in advance!

@bjlbernal
Copy link
Contributor

To avoid assumptions could you supply the example JSON you used?

@juanlu-sanz
Copy link
Author

I think it was this:
json: [
{
"date": "2014-06-03",
"443": "5045",
"995": "498"
},
{
"date": "2014-06-04",
"443": "5000"
},
{
"date": "2014-06-05",
"443": "4678",
"995": "550"
}
]

@bjlbernal
Copy link
Contributor

I was able to replicate it here: http://jsfiddle.net/bjlbernal/Te76A/

Looks like it is a bug in the convertJsonToData. The values are being pushed on to new arrays so the void in the second object is not being represented. Adding a "995": "" in the JSON plots a point at zero so that won't do.

@masayuki0812 , I think this would require changing the index array being used into an associative array or an array of objects.

@masayuki0812
Copy link
Member

Hi, Thank you for the investigation. Actually it's a bug and I fixed. Please try the code that includes the commit above.

@juanlu-sanz
Copy link
Author

Hi again:

This problem is solved (thank you!) but now I can't see the line connecting the dots on the second array (data with label 995) neither in my own implementation nor here http://jsfiddle.net/bjlbernal/Te76A/

@masayuki0812
Copy link
Member

Thank you for confirming.
The point of undefined/null will not be connected as default. Please use line.connect_null = true to get them connected.

@juanlu-sanz
Copy link
Author

Everything works!

Thank you very much for your work! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug resolved maybe
Projects
None yet
Development

No branches or pull requests

3 participants