Skip to content
This repository was archived by the owner on May 18, 2019. It is now read-only.
This repository was archived by the owner on May 18, 2019. It is now read-only.

Line chart format Date in x axis #342

@darioenginius

Description

@darioenginius

Hi,
I'm trying to format the values on the X axis in Line Chart in order to display a formatted date (DD-MM-YYY or DD/MM, ecc...).
In Bar chart it works fine, but not in Line Chart.
I read this issue (#70) and the relative documentation (https://github.com/esbullington/react-d3/wiki/Dates), but still doesn't work.
I tried multiple times, from the initial value on data object ('2017-01-10', timestamp, new Date(), ecc..), to format in xAccessor (return new Date(d.x) and d3.time.format), and finally in xAxisTickInterval with unit 'year'/'day', but no combination works.
I get different errors:

  • var n = d3_time_numberRe.exec(string.slice(i, i + 2)); => error on slice because string became a Date Object
  • cannot read property 'foreach' of undefined
  • attribute d: expected number, "mnan,nanlnan,nan

which is the right way to do this?
ps: I tried exactly the example on https://github.com/esbullington/react-d3/wiki/Dates but doesn't work.

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions