Browse Source

Merge master fix

pull/476/head
Masayuki Tanaka 11 years ago
parent
commit
a0801cb474
  1. 11
      src/c3.axis.js
  2. 5
      src/shape.js
  3. 2
      src/tooltip.js

11
src/c3.axis.js

@ -176,8 +176,15 @@ function c3_axis(d3, isCategory) {
return axis;
};
axis.tickValues = function (x) {
if (!arguments.length) { return tickValues; }
tickValues = x;
if (typeof x === 'function') {
tickValues = function () {
return x(scale.domain());
};
}
else {
if (!arguments.length) { return tickValues; }
tickValues = x;
}
return axis;
};
return axis;

5
src/shape.js

@ -169,9 +169,12 @@ c3_chart_internal_fn.generateDrawArea = function (areaIndices, isSub) {
};
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) {
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)) {
path = area.interpolate($$.getInterpolate(d))(data);
} else {

2
src/tooltip.js

@ -84,7 +84,7 @@ c3_chart_internal_fn.showTooltip = function (selectedData, mouse) {
if (tooltipRight > chartRight) {
tooltipLeft -= tooltipRight - chartRight;
}
if (tooltipTop + tHeight > $$.getCurrentHeight()) {
if (tooltipTop + tHeight > $$.getCurrentHeight() && tooltipTop > tHeight + 30) {
tooltipTop -= tHeight + 30;
}
}

Loading…
Cancel
Save