opendash
Version:
open.DASH data visualization framework
20 lines • 723 B
JavaScript
import React from "react";
import Highcharts from "highcharts";
export var HighchartsChart = React.memo(function (_a) {
var options = _a.options, style = _a.style;
var element = React.useRef(null);
var chart = React.useRef(null);
React.useEffect(function () {
chart.current = Highcharts.chart(element.current, options);
return function () {
chart.current.destroy();
};
}, []);
React.useEffect(function () {
if (chart.current) {
chart.current.update(options, true, true, true);
}
}, [options]);
return React.createElement("div", { ref: element, style: style });
});
//# sourceMappingURL=HighchartsChart.js.map