Browse Source

Remove pie.sort and donut.sort options

pull/590/head
Masayuki Tanaka 10 years ago
parent
commit
9ee5464e7c
  1. 10
      c3.js
  2. 6
      c3.min.js
  3. 8
      src/arc.js
  4. 2
      src/config.js

10
c3.js

@ -1011,7 +1011,6 @@
pie_label_show: true,
pie_label_format: undefined,
pie_label_threshold: 0.05,
pie_sort: true,
pie_expand: true,
// gauge
gauge_label_show: true,
@ -1026,7 +1025,6 @@
donut_label_format: undefined,
donut_label_threshold: 0.05,
donut_width: undefined,
donut_sort: true,
donut_expand: true,
donut_title: "",
// region - region to change style
@ -4153,7 +4151,7 @@
$$.pie = d3.layout.pie().value(function (d) {
return d.values.reduce(function (a, b) { return a + b.value; }, 0);
});
if (!config.data_order || !config.pie_sort || !config.donut_sort) {
if (!config.data_order) {
$$.pie.sort(null);
}
};
@ -4177,7 +4175,7 @@
c3_chart_internal_fn.updateAngle = function (d) {
var $$ = this, config = $$.config,
found = false, index = 0;
$$.pie($$.filterTargetsToShow($$.data.targets)).sort($$.descByStartAngle).forEach(function (t) {
$$.pie($$.filterTargetsToShow($$.data.targets)).forEach(function (t) {
if (! found && t.data.id === d.data.id) {
found = true;
d = t;
@ -4347,10 +4345,6 @@
return $$.hasType('donut') ? $$.config.donut_title : "";
};
c3_chart_internal_fn.descByStartAngle = function (a, b) {
return a.startAngle - b.startAngle;
};
c3_chart_internal_fn.updateTargetsForArc = function (targets) {
var $$ = this, main = $$.main,
mainPieUpdate, mainPieEnter,

6
c3.min.js vendored

File diff suppressed because one or more lines are too long

8
src/arc.js

@ -3,7 +3,7 @@ c3_chart_internal_fn.initPie = function () {
$$.pie = d3.layout.pie().value(function (d) {
return d.values.reduce(function (a, b) { return a + b.value; }, 0);
});
if (!config.data_order || !config.pie_sort || !config.donut_sort) {
if (!config.data_order) {
$$.pie.sort(null);
}
};
@ -27,7 +27,7 @@ c3_chart_internal_fn.updateArc = function () {
c3_chart_internal_fn.updateAngle = function (d) {
var $$ = this, config = $$.config,
found = false, index = 0;
$$.pie($$.filterTargetsToShow($$.data.targets)).sort($$.descByStartAngle).forEach(function (t) {
$$.pie($$.filterTargetsToShow($$.data.targets)).forEach(function (t) {
if (! found && t.data.id === d.data.id) {
found = true;
d = t;
@ -197,10 +197,6 @@ c3_chart_internal_fn.getArcTitle = function () {
return $$.hasType('donut') ? $$.config.donut_title : "";
};
c3_chart_internal_fn.descByStartAngle = function (a, b) {
return a.startAngle - b.startAngle;
};
c3_chart_internal_fn.updateTargetsForArc = function (targets) {
var $$ = this, main = $$.main,
mainPieUpdate, mainPieEnter,

2
src/config.js

@ -144,7 +144,6 @@ c3_chart_internal_fn.getDefaultConfig = function () {
pie_label_show: true,
pie_label_format: undefined,
pie_label_threshold: 0.05,
pie_sort: true,
pie_expand: true,
// gauge
gauge_label_show: true,
@ -159,7 +158,6 @@ c3_chart_internal_fn.getDefaultConfig = function () {
donut_label_format: undefined,
donut_label_threshold: 0.05,
donut_width: undefined,
donut_sort: true,
donut_expand: true,
donut_title: "",
// region - region to change style

Loading…
Cancel
Save