UNPKG

@progress/kendo-react-charts

Version:

React Chart renders a wide range of high-quality data visualizations. KendoReact Charts package

70 lines (69 loc) 2.05 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 * as s from "react"; import { BaseChart as n } from "./BaseChart.mjs"; import { StockChart as i } from "@progress/kendo-charts"; import { classNames as o } from "@progress/kendo-react-common"; const h = { autoBindElements: !0, liveDrag: !1, partialRedraw: !0 }; class m extends s.Component { constructor() { super(...arguments), this._baseChart = null, this.deriveOptionsFromParent = (t) => { const e = Object.assign({}, t.navigator || {}, h); return Object.assign({}, t, { navigator: e }); }, this.onRefresh = (t, e, r) => { this.props.partialRedraw ? (r.applyOptions(t), r.bindCategories(), r.navigator.redrawSlaves()) : r.setOptions(t, e); }, this.getTarget = () => this; } /** * @hidden */ get chartInstance() { return this._baseChart !== null ? this._baseChart.chartInstance : null; } /** * The Drawing `Surface` of the StockChart. */ get surface() { return this._baseChart !== null ? this._baseChart.surface : null; } /** * The DOM element of the StockChart. */ get element() { return this._baseChart !== null ? this._baseChart.element : null; } /** * @hidden */ render() { const { children: t, className: e, ...r } = this.props; return /* @__PURE__ */ s.createElement( n, { ...r, ref: (a) => { this._baseChart = a; }, chartConstructor: i, getTarget: this.getTarget, wrapper: "div", deriveOptionsFromParent: this.deriveOptionsFromParent, onRefresh: this.onRefresh, className: o("k-chart k-stockchart", e) }, t ); } } export { m as StockChart };