Skip to content
This repository has been archived by the owner on Dec 26, 2018. It is now read-only.

ToolTip fails in LineChart for Date objects #42

Open
ebertmi opened this issue Jun 21, 2016 · 4 comments
Open

ToolTip fails in LineChart for Date objects #42

ebertmi opened this issue Jun 21, 2016 · 4 comments
Labels

Comments

@ebertmi
Copy link

ebertmi commented Jun 21, 2016

I've some data series which look like this:

let series = [{
 name: 'test',
 values: [{date: new Date(), count: 3}]
}];

I forked the LineChart Fiddle to demonstrate the problem: https://jsfiddle.net/Le5vt2ot/

After some debugging I found the error in Line 81 in DataSeries.js:
if (Object.prototype.toString.call(xAccessor(point)) === '[object Date]') {

The point object as this place has only a x and y value, but no date or count as expected by the accessor. Therefore, the call fails and returns null/undefined.

@yang-wei
Copy link
Owner

Thanks for reporting.

Looks like this is a bug =(

@yang-wei yang-wei added the bug label Jun 22, 2016
@dmk23
Copy link

dmk23 commented Jul 24, 2016

any update / ETA on the fix?

@fawazlab
Copy link

fawazlab commented Aug 3, 2016

I believe the open pull request #69 will fix this issue.

@themre
Copy link

themre commented Oct 2, 2016

My override works:
tooltipFormat={d => { return String(moment(d.xValue).format("YYYY-MM-DD")) }}

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

No branches or pull requests

5 participants