Browse Source

markers++

pull/33/head
glitch4347 12 months ago
parent
commit
d97b0e9b0c
  1. 12
      react/ChartwerkLinePod.tsx
  2. 1
      src/index.ts

12
react/ChartwerkLinePod.tsx

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

1
src/index.ts

@ -33,7 +33,6 @@ class LinePod extends ChartwerkPod<LineTimeSerie, LineOptions> {
) { ) {
super(_el, _series, _options); super(_el, _series, _options);
this.series = new LineSeries(_series); this.series = new LineSeries(_series);
console.log('CREATE LINPOD NEW VERSION')
} }
override renderMetrics(): void { override renderMetrics(): void {

Loading…
Cancel
Save