Browse Source

Add donut.width and remove donut.radius.inner

pull/452/head
Masayuki Tanaka 10 years ago
parent
commit
fb34590979
  1. 18
      c3.js
  2. 4
      c3.min.js
  3. 4
      htdocs/samples/chart_donut.html

18
c3.js

@ -282,7 +282,7 @@
var __donut_label_show = getConfig(['donut', 'label', 'show'], true),
__donut_label_format = getConfig(['donut', 'label', 'format']),
__donut_label_threshold = getConfig(['donut', 'label', 'threshold'], 0.05),
__donut_radius_inner = getConfig(['donut', 'radius', 'inner']),
__donut_width = getConfig(['donut', 'width']),
__donut_sort = getConfig(['donut', 'sort'], true),
__donut_expand = getConfig(['donut', 'expand'], true),
__donut_title = getConfig(['donut', 'title'], "");
@ -530,21 +530,11 @@
.attr("y2", __axis_rotated ? -10 : height);
}
function updateRadius() {
var innerRadiusRatio;
var innerRadiusRatio, w = __gauge_width || __donut_width;
radiusExpanded = Math.min(arcWidth, arcHeight) / 2;
radius = radiusExpanded * 0.95;
innerRadiusRatio = __gauge_width ? (radius - __gauge_width) / radius : 0.6;
if (hasDonutType(c3.data.targets) || hasGaugeType(c3.data.targets)) {
if (typeof __donut_radius_inner === 'function') {
innerRadius = __donut_radius_inner(radius, innerRadiusRatio);
} else if (__donut_radius_inner) {
innerRadius = __donut_radius_inner;
} else {
innerRadius = radius * innerRadiusRatio;
}
} else {
innerRadius = 0;
}
innerRadiusRatio = w ? (radius - w) / radius : 0.6;
innerRadius = hasDonutType(c3.data.targets) || hasGaugeType(c3.data.targets) ? radius * innerRadiusRatio : 0;
}
function getSvgLeft() {
var leftAxisClass = __axis_rotated ? CLASS.axisX : CLASS.axisY,

4
c3.min.js vendored

File diff suppressed because one or more lines are too long

4
htdocs/samples/chart_donut.html

@ -36,9 +36,7 @@
// format: function (d, ratio) { return ""; }
},
title: "Iris Petal Width",
radius: {
inner: 60
}
width: 70
}
});

Loading…
Cancel
Save