71 lines
2.1 KiB
JavaScript
71 lines
2.1 KiB
JavaScript
(function (t, e) {
|
|
typeof exports === "object" && typeof module !== "undefined" ? e(exports, require("highcharts")) : typeof define === "function" && define.amd ? define(["exports", "highcharts"], e) : (t = t || self, e(t.VueHighcharts = {}, t.Highcharts))
|
|
})(this, function (t, o) {
|
|
"use strict";
|
|
o = o && o.hasOwnProperty("default") ? o["default"] : o;
|
|
var h = {Highcharts: "chart", Highstock: "stockChart", Highmaps: "mapChart", HighchartsGantt: "ganttChart"};
|
|
|
|
function i(t) {
|
|
var e;
|
|
if (t === null || typeof t !== "object") {
|
|
return t
|
|
}
|
|
if (t instanceof Array) {
|
|
e = [];
|
|
for (var n = t.length - 1; n >= 0; n--) {
|
|
e[n] = i(t[n])
|
|
}
|
|
return e
|
|
}
|
|
if (t instanceof Object) {
|
|
e = {};
|
|
for (var r in t) {
|
|
e[r] = i(t[r])
|
|
}
|
|
return e
|
|
}
|
|
}
|
|
|
|
function r(t) {
|
|
return t("div")
|
|
}
|
|
|
|
function a(t, e) {
|
|
var n = e[h[t]];
|
|
if (!n) {
|
|
return e.win ? null : {render: r}
|
|
}
|
|
return {
|
|
name: t, props: {options: {type: Object, required: true}}, watch: {
|
|
options: {
|
|
handler: function () {
|
|
this.$_h_render()
|
|
}, deep: true
|
|
}
|
|
}, mounted: function () {
|
|
this.$_h_render()
|
|
}, beforeDestroy: function () {
|
|
this.chart.destroy()
|
|
}, methods: {
|
|
$_h_render: function () {
|
|
this.chart = n(this.$el, i(this.options))
|
|
}
|
|
}, render: r
|
|
}
|
|
}
|
|
|
|
function e(t, e) {
|
|
var n = e && e.Highcharts || o;
|
|
for (var r in h) {
|
|
var i = a(r, n);
|
|
i && t.component(r, i)
|
|
}
|
|
}
|
|
|
|
if (typeof window !== "undefined" && window.Vue && window.Highcharts) {
|
|
e(window.Vue, window.Highcharts)
|
|
}
|
|
t.default = e;
|
|
t.genComponent = a;
|
|
Object.defineProperty(t, "__esModule", {value: true})
|
|
}); |