You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
581 B
20 lines
581 B
1 year ago
|
import {ChartInternal} from './chart-internal';
|
||
|
|
||
|
export function Chart(config) {
|
||
|
var $$ = this.internal = new ChartInternal(this);
|
||
|
$$.loadConfig(config);
|
||
|
|
||
|
$$.beforeInit(config);
|
||
|
$$.init();
|
||
|
$$.afterInit(config);
|
||
|
|
||
|
// bind "this" to nested API
|
||
|
(function bindThis(fn, target, argThis) {
|
||
|
Object.keys(fn).forEach(function (key) {
|
||
|
target[key] = fn[key].bind(argThis);
|
||
|
if (Object.keys(fn[key]).length > 0) {
|
||
|
bindThis(fn[key], target[key], argThis);
|
||
|
}
|
||
|
});
|
||
|
})(Chart.prototype, this, this);
|
||
|
}
|