Browse Source

codestyle

pull/33/head
glitch4347 12 months ago
parent
commit
869488d405
  1. 11
      react/ChartwerkLinePod.tsx

11
react/ChartwerkLinePod.tsx

@ -48,25 +48,18 @@ export function ChartwerkLinePod(props: ChartwerkLinePodProps) {
useEffect(() => { useEffect(() => {
if(chart === null) { return; } if(chart === null) { return; }
if(pod === null) { if(pod === null) {
console.log('create chart');
console.log("markers");
console.log(props.markers);
const newPod = new LinePod( const newPod = new LinePod(
// @ts-ignore // @ts-ignore
chart, chart,
props.series, props.series,
props.options, props.options,
props.markers, props.markers,
// props.segments props.segments
); );
setPod(newPod); setPod(newPod);
newPod.render(); newPod.render();
} else { } else {
console.log('update data'); pod.updateData(props.series, props.options);
pod.updateData(props.series, {
...props.options,
});
} }
}, [chart, pod, props.id, props.options, props.markers, props.segments]); }, [chart, pod, props.id, props.options, props.markers, props.segments]);

Loading…
Cancel
Save