Skip to content

Commit

Permalink
fix(line-graph): isUTC does NOT Display UTC Times in X Axis (#110)
Browse files Browse the repository at this point in the history
  • Loading branch information
DmitriWolf authored and tw15egan committed Jun 8, 2018
1 parent 4367b31 commit 6ea676c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion components/LineGraph/LineGraph.js
Original file line number Diff line number Diff line change
Expand Up @@ -313,11 +313,15 @@ class LineGraph extends Component {
.y(d => this.y(d[this.count]))
.defined(d => !isNaN(d[this.count]));

const tickFormat = isUTC
? d3.utcFormat(timeFormat)
: d3.timeFormat(timeFormat);

this.xAxis = d3
.axisBottom()
.scale(this.x)
.tickSize(0)
.tickFormat(isXTime ? d3.timeFormat(timeFormat) : null);
.tickFormat(isXTime ? tickFormat : null);

this.yAxis = d3
.axisLeft()
Expand Down

0 comments on commit 6ea676c

Please sign in to comment.