rd3
rd3 copied to clipboard
ToolTip fails in LineChart for Date objects
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.
Thanks for reporting.
Looks like this is a bug =(
any update / ETA on the fix?
I believe the open pull request #69 will fix this issue.
My override works:
tooltipFormat={d => { return String(moment(d.xValue).format("YYYY-MM-DD")) }}