Skip to content

Commit

Permalink
Hotfix nvd3's secondary xaxis uses the wrong formating
Browse files Browse the repository at this point in the history
  • Loading branch information
mistercrunch committed Mar 1, 2016
1 parent b36b1ef commit 8c525b7
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions panoramix/assets/visualizations/nvd3_vis.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ function nvd3Vis(slice) {
chart.lines2.xScale(d3.time.scale.utc());
chart.x2Axis
.showMaxMin(fd.x_axis_showminmax)
.staggerLabels(true);
.staggerLabels(false);
} else {
chart = nv.models.lineChart()
}
Expand Down Expand Up @@ -153,9 +153,16 @@ function nvd3Vis(slice) {
}
else if (fd.x_axis_format == 'smart_date') {
chart.xAxis.tickFormat(px.formatDate);
if(chart.hasOwnProperty("x2Axis")) {
chart.x2Axis.tickFormat(px.formatDate);
}
}
else if (fd.x_axis_format !== undefined) {
chart.xAxis.tickFormat(px.timeFormatFactory(fd.x_axis_format));
var tf = px.timeFormatFactory(fd.x_axis_format);
chart.xAxis.tickFormat(tf);
if(chart.hasOwnProperty("x2Axis")) {
chart.x2Axis.tickFormat(tf);
}
}
if (chart.yAxis !== undefined) {
chart.yAxis.tickFormat(d3.format('.3s'));
Expand Down

0 comments on commit 8c525b7

Please sign in to comment.