Commit adbe644e authored by Masayuki Tanaka's avatar Masayuki Tanaka

Fix x axis tick

parent ae8cf74b
...@@ -1527,6 +1527,7 @@ ...@@ -1527,6 +1527,7 @@
tickValues.push(end); tickValues.push(end);
} }
} }
if (!isTimeSeries) { tickValues = tickValues.sort(); }
return tickValues; return tickValues;
} }
function addHiddenTargetIds(targetIds) { function addHiddenTargetIds(targetIds) {
...@@ -3001,7 +3002,7 @@ ...@@ -3001,7 +3002,7 @@
// update axis tick values according to options, except for scatter plot // update axis tick values according to options, except for scatter plot
if (! hasScatterType(targetsToShow)) { // TODO: fix this if (! hasScatterType(targetsToShow)) { // TODO: fix this
tickValues = generateTickValues(mapTargetsToUniqueXs(targetsToShow)).sort(); tickValues = generateTickValues(mapTargetsToUniqueXs(targetsToShow));
xAxis.tickValues(tickValues); xAxis.tickValues(tickValues);
subXAxis.tickValues(tickValues); subXAxis.tickValues(tickValues);
} }
...@@ -3029,9 +3030,11 @@ ...@@ -3029,9 +3030,11 @@
break; break;
} }
} }
d3.selectAll('.' + CLASS.axisX + ' .tick').sort(function (e1, e2) { return e1 - e2; }); d3.selectAll('.' + CLASS.axisX + ' .tick text').each(function (e) {
d3.selectAll('.' + CLASS.axisX + ' .tick text').each(function (e, i) { var index = tickValues.indexOf(e);
d3.select(this).style('display', i % intervalForCulling ? 'none' : 'block'); if (index > 0) {
d3.select(this).style('display', index % intervalForCulling ? 'none' : 'block');
}
}); });
} }
......
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment