UNPKG

@progress/kendo-vue-charts

Version:
147 lines (146 loc) 3.58 kB
/** * @license *------------------------------------------------------------------------------------------- * Copyright © 2025 Progress Software Corporation. All rights reserved. * Licensed under commercial license. See LICENSE.md in the package root for more information *------------------------------------------------------------------------------------------- */ import { defineComponent as p, createVNode as c, isVNode as b } from "vue"; import { BaseChart as C } from "./BaseChart.mjs"; import { StockChart as m } from "@progress/kendo-charts"; import { getRef as a, getDefaultSlots as g, setRef as v, classNames as y } from "@progress/kendo-vue-common"; function O(e) { return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !b(e); } const D = { autoBindElements: !0, liveDrag: !1, partialRedraw: !0 }, A = /* @__PURE__ */ p({ name: "KendoStockChart", props: { partialRedraw: { type: Boolean, default: void 0 }, dir: String, renderAs: { type: String, default: void 0, validator: function(e) { return ["svg", "canvas"].includes(e); } }, pannable: { type: [Boolean, Object], default: function() { } }, zoomable: { type: [Boolean, Object], default: function() { } }, seriesColors: { type: Array, default: function() { } }, transitions: { type: Boolean, default: !0 }, paneDefaults: { type: Object, default: function() { } }, panes: { type: Array, default: function() { } }, seriesDefaults: { type: Object, default: function() { } }, axisDefaults: { type: Object, default: function() { } } }, updated() { this.baseChart = a(this, "baseChart"); }, mounted() { this.baseChart = a(this, "baseChart"); }, methods: { chartInstance() { return this.baseChart !== null ? this.baseChart.chartInstance : null; }, surface() { return this.baseChart !== null ? this.baseChart.surface : null; }, element() { return this.baseChart !== null ? this.baseChart.element : null; }, getTarget() { return this; }, deriveOptionsFromParent(e) { const t = Object.assign({}, e.navigator || {}, D); return Object.assign({}, e, { navigator: t }); }, onRefresh(e, t, r) { this.$props.partialRedraw ? (r.applyOptions(e), r.bindCategories(), r.navigator.redrawSlaves()) : r.setOptions(e, t); }, handleBaseChartEvents(e, t) { this.$emit(e, t); } }, render() { const e = g(this), { partialRedraw: t, dir: r, renderAs: n, pannable: s, zoomable: i, seriesColors: o, transitions: u, paneDefaults: l, panes: d, seriesDefaults: f, axisDefaults: h } = this.$props; return c(C, { dir: r, renderAs: n, pannable: s, zoomable: i, seriesColors: o, transitions: u, paneDefaults: l, panes: d, seriesDefaults: f, axisDefaults: h, ref: v(this, "baseChart"), chartConstructor: m, getTarget: this.getTarget, wrapper: "div", deriveOptionsFromParent: this.deriveOptionsFromParent, onRefresh: this.onRefresh, class: y("k-chart k-stockchart"), onBasechartevent: this.handleBaseChartEvents }, O(e) ? e : { default: () => [e] }); } }); export { A as StockChart };