|
|
@ -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]); |
|
|
|
|
|
|
|
|
|
|
|