|
|
|
@ -39,19 +39,14 @@ export function ChartwerkLinePod(props: ChartwerkLinePodProps) {
|
|
|
|
|
useEffect(() => { |
|
|
|
|
// this function will be called on component unmount
|
|
|
|
|
return () => { |
|
|
|
|
if(pod === null) { |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
if(pod === null) { return; } |
|
|
|
|
// @ts-ignore
|
|
|
|
|
pod.removeEventListeners(); |
|
|
|
|
} |
|
|
|
|
}, []); |
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
|
if(chart === null) { |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if(chart === null) { return; } |
|
|
|
|
if(pod === null) { |
|
|
|
|
console.log('create chart'); |
|
|
|
|
console.log("markers"); |
|
|
|
@ -63,11 +58,12 @@ export function ChartwerkLinePod(props: ChartwerkLinePodProps) {
|
|
|
|
|
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, |
|
|
|
|
}); |
|
|
|
|