Browse Source

Introduce initChartElements() - #740

pull/742/head
Masayuki Tanaka 10 years ago
parent
commit
91fcd44c54
  1. 22
      c3.js
  2. 10
      c3.min.js
  3. 22
      src/core.js

22
c3.js

@ -143,6 +143,14 @@
$$.axes.subx = d3.selectAll([]); // needs when excluding subchart.js
};
c3_chart_internal_fn.initChartElements = function () {
if (this.initBar) { this.initBar(); }
if (this.initLine) { this.initLine(); }
if (this.initArc) { this.initArc(); }
if (this.initGauge) { this.initGauge(); }
if (this.initText) { this.initText(); }
};
c3_chart_internal_fn.initWithData = function (data) {
var $$ = this, d3 = $$.d3, config = $$.config;
var defs, main, binding = true;
@ -245,18 +253,8 @@
// Cover whole with rects for events
$$.initEventRect();
// Define g for bar chart area
if ($$.initBar) { $$.initBar(); }
// Define g for line chart area
if ($$.initLine) { $$.initLine(); }
// Define g for arc chart area
if ($$.initArc) { $$.initArc(); }
if ($$.initGauge) { $$.initGauge(); }
// Define g for text area
if ($$.initText) { $$.initText(); }
// Define g for chart
$$.initChartElements();
// if zoom privileged, insert rect to forefront
// TODO: is this needed?

10
c3.min.js vendored

File diff suppressed because one or more lines are too long

22
src/core.js

@ -138,6 +138,14 @@ c3_chart_internal_fn.initParams = function () {
$$.axes.subx = d3.selectAll([]); // needs when excluding subchart.js
};
c3_chart_internal_fn.initChartElements = function () {
if (this.initBar) { this.initBar(); }
if (this.initLine) { this.initLine(); }
if (this.initArc) { this.initArc(); }
if (this.initGauge) { this.initGauge(); }
if (this.initText) { this.initText(); }
};
c3_chart_internal_fn.initWithData = function (data) {
var $$ = this, d3 = $$.d3, config = $$.config;
var defs, main, binding = true;
@ -240,18 +248,8 @@ c3_chart_internal_fn.initWithData = function (data) {
// Cover whole with rects for events
$$.initEventRect();
// Define g for bar chart area
if ($$.initBar) { $$.initBar(); }
// Define g for line chart area
if ($$.initLine) { $$.initLine(); }
// Define g for arc chart area
if ($$.initArc) { $$.initArc(); }
if ($$.initGauge) { $$.initGauge(); }
// Define g for text area
if ($$.initText) { $$.initText(); }
// Define g for chart
$$.initChartElements();
// if zoom privileged, insert rect to forefront
// TODO: is this needed?

Loading…
Cancel
Save