Update c3.js and c3.min.js

parent bc987b21
......@@ -8087,6 +8087,25 @@
var start = domain[0], stop = domain[domain.length - 1];
return start < stop ? [ start, stop ] : [ stop, start ];
}
function shouldDrawTickText(id){
if(!$$.config.axis_rotated) return true;
var widthLimits = [
// Left is width, right is number of tick labels to be removed
[-Infinity],
[200, 10],
[300, 5],
[450, 2],
[Infinity, 1]
];
var divisor;
for(var i = widthLimits.length-1; i--; ){
if($$.currentWidth > widthLimits[i][0]) {
divisor = widthLimits[i+1][1];
break;
}
}
return !(id%divisor);
}
function generateTicks(scale) {
var i, domain, ticks = [];
if (scale.ticks) {
......@@ -8222,6 +8241,13 @@
}
text = tick.select("text");
if($$.config.axis_rotated && orient === 'bottom') {
text.style('display', function(d, i){
return shouldDrawTickText(i) ? 'block' : 'none';
});
}
tspan = text.selectAll('tspan')
.data(function (d, i) {
var splitted = params.tickMultiline ? splitTickText(d, params.tickWidth) : [].concat(textFormatted(d));
......
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