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

using dates in linechart as x axis not working #338

Open
aTylerRice opened this issue Jan 23, 2017 · 0 comments
Open

using dates in linechart as x axis not working #338

aTylerRice opened this issue Jan 23, 2017 · 0 comments

Comments

@aTylerRice
Copy link

I've tried multiple things to get this worker even tried the solution in the other issue, but to no avail.

I have an x axis that is passing in unix dates in the x function like so:

x = function(d) {
     return d.x;
   }

then here is my line chart code:

var dateFormatter = d3.time.format("%d-%m-%Y");
tickDateFormatter = function(d) {
     console.log(d);
    return dateFormatter(new Date(d.x));
  }
<LineChart data={downloadChartDataPoints} chartSeries={chartSeries} x={x} xAxisTickCount={30}
  xAxisTickFormat={tickDateFormatter} />

I am still getting the x label output as the unix timestamp numbers rather than the formatted date. If I remove the x function from the props from linechart I get an error that says x function doesn't exist.

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

No branches or pull requests

1 participant