Browse Source

Fix negative height and width - #64

pull/104/head 0.1.23
Masayuki Tanaka 11 years ago
parent
commit
ca043ae6c4
  1. 4
      c3.js
  2. 2
      c3.min.js

4
c3.js

@ -287,6 +287,8 @@
}; };
width = currentWidth - margin.left - margin.right; width = currentWidth - margin.left - margin.right;
height = currentHeight - margin.top - margin.bottom; height = currentHeight - margin.top - margin.bottom;
if (width < 0) { width = 0; }
if (height < 0) { height = 0; }
// for context // for context
margin2 = { margin2 = {
@ -297,6 +299,8 @@
}; };
width2 = __axis_rotated ? margin.left - rotated_padding_left - rotated_padding_right : width; width2 = __axis_rotated ? margin.left - rotated_padding_left - rotated_padding_right : width;
height2 = __axis_rotated ? height : currentHeight - margin2.top - margin2.bottom; height2 = __axis_rotated ? height : currentHeight - margin2.top - margin2.bottom;
if (width2 < 0) { width2 = 0; }
if (height2 < 0) { height2 = 0; }
// for legend // for legend
margin3 = { margin3 = {

2
c3.min.js vendored

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save