Browse Source

Fix position of data label on flow

pull/486/head
Masayuki Tanaka 11 years ago
parent
commit
248324db32
  1. 2
      c3.js
  2. 2
      c3.min.js
  3. 2
      src/shape.js

2
c3.js

@ -2981,7 +2981,7 @@
padding = $$.isBarType(d) ? 4 : 6;
xPos = points[2][1] + padding * (d.value < 0 ? -1 : 1);
} else {
xPos = points[0][0] + (points[2][0] - points[0][0]) / 2;
xPos = $$.hasType('bar') ? (points[2][0] + points[0][0]) / 2 : points[0][0];
}
return xPos > $$.width ? $$.width - box.width : xPos;
};

2
c3.min.js vendored

File diff suppressed because one or more lines are too long

2
src/shape.js

@ -235,7 +235,7 @@ c3_chart_internal_fn.getXForText = function (points, d, textElement) {
padding = $$.isBarType(d) ? 4 : 6;
xPos = points[2][1] + padding * (d.value < 0 ? -1 : 1);
} else {
xPos = points[0][0] + (points[2][0] - points[0][0]) / 2;
xPos = $$.hasType('bar') ? (points[2][0] + points[0][0]) / 2 : points[0][0];
}
return xPos > $$.width ? $$.width - box.width : xPos;
};

Loading…
Cancel
Save