c3js / c3js/c3

JS error in tooltips when data is null for a timeline chart

Open
#1,503 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
9.3k
Forks
1.4k
Avg merge
6d 16h
Merged PRs (30d)
1

Description

Hi

I am having a problem when my data is not “matching” and some values are null in a certain date, js trows a series of errors that data is null "TypeError: null is not an object (evaluating 'b.value’)” and the tooltip doesn’t show

I did not tested but looks like a small fix could be to set as 0 if the value is null

So here it’s just a case to have an if testing the value of “b” before return.

i.categoryName = function(a) {
var b = this.config;
return a < b.axis_x_categories.length ? b.axis_x_categories[a] : a
}

But I am not sure if it’s the case

Sorry if my explanation wasn’t great

![captura_de_tela_2015-12-11_as_16_10_02](https://cloud.githubusercontent.com/assets/11443180/11748767/cd0cfa78-a021-11e5-847f-72139eda0bc1.png)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.