rd3 icon indicating copy to clipboard operation
rd3 copied to clipboard

ToolTip fails in LineChart for Date objects

Open ebertmi opened this issue 8 years ago • 4 comments

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.

ebertmi avatar Jun 21 '16 16:06 ebertmi

Thanks for reporting.

Looks like this is a bug =(

yang-wei avatar Jun 22 '16 13:06 yang-wei

any update / ETA on the fix?

dmk23 avatar Jul 24 '16 02:07 dmk23

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

fawazlab avatar Aug 03 '16 14:08 fawazlab

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

themre avatar Oct 02 '16 12:10 themre