Commit 1d105c1a authored by Masayuki Tanaka's avatar Masayuki Tanaka

Update c3.js and c3.min.js

parent a0801cb4
...@@ -516,7 +516,7 @@ ...@@ -516,7 +516,7 @@
var drawArea, drawBar, drawLine, xForText, yForText; var drawArea, drawBar, drawLine, xForText, yForText;
var duration, durationForExit, durationForAxis, waitForDraw; var duration, durationForExit, durationForAxis, waitForDraw;
var targetsToShow = $$.filterTargetsToShow($$.data.targets), tickValues, i, intervalForCulling; var targetsToShow = $$.filterTargetsToShow($$.data.targets), tickValues, i, intervalForCulling;
var xv, cx, cy; var yv, xv, cx, cy;
xgrid = xgridLines = mainCircle = mainText = d3.selectAll([]); xgrid = xgridLines = mainCircle = mainText = d3.selectAll([]);
...@@ -702,18 +702,18 @@ ...@@ -702,18 +702,18 @@
.attr('dy', -5) .attr('dy', -5)
.style("opacity", 0); .style("opacity", 0);
// update // update
var yv_ = generateCall($$.yv, $$); yv = generateCall($$.yv, $$);
ygridLines.select('line') ygridLines.select('line')
.transition().duration(duration) .transition().duration(duration)
.attr("x1", config[__axis_rotated] ? yv_ : 0) .attr("x1", config[__axis_rotated] ? yv : 0)
.attr("x2", config[__axis_rotated] ? yv_ : $$.width) .attr("x2", config[__axis_rotated] ? yv : $$.width)
.attr("y1", config[__axis_rotated] ? 0 : yv_) .attr("y1", config[__axis_rotated] ? 0 : yv)
.attr("y2", config[__axis_rotated] ? $$.height : yv_) .attr("y2", config[__axis_rotated] ? $$.height : yv)
.style("opacity", 1); .style("opacity", 1);
ygridLines.select('text') ygridLines.select('text')
.transition().duration(duration) .transition().duration(duration)
.attr("x", config[__axis_rotated] ? 0 : $$.width) .attr("x", config[__axis_rotated] ? 0 : $$.width)
.attr("y", yv_) .attr("y", yv)
.text(function (d) { return d.text; }) .text(function (d) { return d.text; })
.style("opacity", 1); .style("opacity", 1);
// exit // exit
...@@ -1886,8 +1886,13 @@ ...@@ -1886,8 +1886,13 @@
config[__tooltip_init_x] = 0; config[__tooltip_init_x] = 0;
config[__tooltip_init_position] = {top: '0px', left: '50px'}; config[__tooltip_init_position] = {top: '0px', left: '50px'};
Object.keys(this.additionalConfig).forEach(function (key) {
config[key] = this.additionalConfig[key];
}, this);
return config; return config;
}; };
c3_chart_internal_fn.additionalConfig = {};
c3_chart_internal_fn.loadConfig = function (config) { c3_chart_internal_fn.loadConfig = function (config) {
var this_config = this.config, target, keys, read; var this_config = this.config, target, keys, read;
...@@ -3072,9 +3077,12 @@ ...@@ -3072,9 +3077,12 @@
}; };
area = config[__axis_rotated] ? area.x0(value0).x1(value1).y(xValue) : area.x(xValue).y0(value0).y1(value1); area = config[__axis_rotated] ? area.x0(value0).x1(value1).y(xValue) : area.x(xValue).y0(value0).y1(value1);
if (!config[__line_connect_null]) {
area = area.defined(function (d) { return d.value !== null; });
}
return function (d) { return function (d) {
var data = $$.filterRemoveNull(d.values), x0 = 0, y0 = 0, path; var data = config[__line_connect_null] ? $$.filterRemoveNull(d.values) : d.values, x0 = 0, y0 = 0, path;
if ($$.isAreaType(d)) { if ($$.isAreaType(d)) {
path = area.interpolate($$.getInterpolate(d))(data); path = area.interpolate($$.getInterpolate(d))(data);
} else { } else {
...@@ -3539,7 +3547,7 @@ ...@@ -3539,7 +3547,7 @@
if (tooltipRight > chartRight) { if (tooltipRight > chartRight) {
tooltipLeft -= tooltipRight - chartRight; tooltipLeft -= tooltipRight - chartRight;
} }
if (tooltipTop + tHeight > $$.getCurrentHeight()) { if (tooltipTop + tHeight > $$.getCurrentHeight() && tooltipTop > tHeight + 30) {
tooltipTop -= tHeight + 30; tooltipTop -= tHeight + 30;
} }
} }
...@@ -6119,8 +6127,15 @@ ...@@ -6119,8 +6127,15 @@
return axis; return axis;
}; };
axis.tickValues = function (x) { axis.tickValues = function (x) {
if (!arguments.length) { return tickValues; } if (typeof x === 'function') {
tickValues = x; tickValues = function () {
return x(scale.domain());
};
}
else {
if (!arguments.length) { return tickValues; }
tickValues = x;
}
return axis; return axis;
}; };
return axis; return axis;
......
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