C3: Tooltips are displayed with the incorrect "columns"

Created on 5 Jun 2014  路  7Comments  路  Source: c3js/c3

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!

C-bug resolved maybe

All 7 comments

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

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"
}
]

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.

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

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/

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.

Everything works!

Thank you very much for your work! :+1:

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Zerim picture Zerim  路  3Comments

Saikat-Sinha picture Saikat-Sinha  路  3Comments

udhaya2kmrv picture udhaya2kmrv  路  3Comments

Kreozot picture Kreozot  路  3Comments

zachallia picture zachallia  路  3Comments