|
|
|
@ -48,25 +48,18 @@ export function ChartwerkLinePod(props: ChartwerkLinePodProps) {
|
|
|
|
|
useEffect(() => { |
|
|
|
|
if(chart === null) { return; } |
|
|
|
|
if(pod === null) { |
|
|
|
|
console.log('create chart'); |
|
|
|
|
console.log("markers"); |
|
|
|
|
console.log(props.markers); |
|
|
|
|
|
|
|
|
|
const newPod = new LinePod( |
|
|
|
|
// @ts-ignore
|
|
|
|
|
chart, |
|
|
|
|
props.series, |
|
|
|
|
props.options, |
|
|
|
|
props.markers, |
|
|
|
|
// props.segments
|
|
|
|
|
props.segments |
|
|
|
|
); |
|
|
|
|
setPod(newPod); |
|
|
|
|
newPod.render(); |
|
|
|
|
} 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]); |
|
|
|
|
|
|
|
|
|