Commit 91fcd44c authored by Masayuki Tanaka's avatar Masayuki Tanaka

Introduce initChartElements() - #740

parent 9416914e
...@@ -143,6 +143,14 @@ ...@@ -143,6 +143,14 @@
$$.axes.subx = d3.selectAll([]); // needs when excluding subchart.js $$.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) { c3_chart_internal_fn.initWithData = function (data) {
var $$ = this, d3 = $$.d3, config = $$.config; var $$ = this, d3 = $$.d3, config = $$.config;
var defs, main, binding = true; var defs, main, binding = true;
...@@ -245,18 +253,8 @@ ...@@ -245,18 +253,8 @@
// Cover whole with rects for events // Cover whole with rects for events
$$.initEventRect(); $$.initEventRect();
// Define g for bar chart area // Define g for chart
if ($$.initBar) { $$.initBar(); } $$.initChartElements();
// 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(); }
// if zoom privileged, insert rect to forefront // if zoom privileged, insert rect to forefront
// TODO: is this needed? // TODO: is this needed?
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -138,6 +138,14 @@ c3_chart_internal_fn.initParams = function () { ...@@ -138,6 +138,14 @@ c3_chart_internal_fn.initParams = function () {
$$.axes.subx = d3.selectAll([]); // needs when excluding subchart.js $$.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) { c3_chart_internal_fn.initWithData = function (data) {
var $$ = this, d3 = $$.d3, config = $$.config; var $$ = this, d3 = $$.d3, config = $$.config;
var defs, main, binding = true; var defs, main, binding = true;
...@@ -240,18 +248,8 @@ c3_chart_internal_fn.initWithData = function (data) { ...@@ -240,18 +248,8 @@ c3_chart_internal_fn.initWithData = function (data) {
// Cover whole with rects for events // Cover whole with rects for events
$$.initEventRect(); $$.initEventRect();
// Define g for bar chart area // Define g for chart
if ($$.initBar) { $$.initBar(); } $$.initChartElements();
// 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(); }
// if zoom privileged, insert rect to forefront // if zoom privileged, insert rect to forefront
// TODO: is this needed? // TODO: is this needed?
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment