From 33a59887055244909d753d21838c4f18a4091716 Mon Sep 17 00:00:00 2001 From: lihu Date: Fri, 20 Jan 2023 14:19:56 +0800 Subject: [PATCH] feat: upgrade chart --- ng-sample/package.json | 2 +- ng-sample/src/app/components/overlay.component.ts | 5 ++--- ng-sample/src/app/components/tooltip.component.ts | 2 +- react-sample/src/chart/Overlay.tsx | 4 ++-- react-sample/src/chart/Tooltip.tsx | 2 +- vue-sample/package.json | 2 +- vue-sample/src/chart/Overlay.vue | 5 ++--- 7 files changed, 10 insertions(+), 12 deletions(-) diff --git a/ng-sample/package.json b/ng-sample/package.json index 82563b5..61f598d 100644 --- a/ng-sample/package.json +++ b/ng-sample/package.json @@ -18,7 +18,7 @@ "@angular/platform-browser": "^15.1.0", "@angular/platform-browser-dynamic": "^15.1.0", "@angular/router": "^15.1.0", - "klinecharts": "^9.0.0-alpha5", + "klinecharts": "^9.0.0-alpha6", "rxjs": "~7.8.0", "tslib": "^2.3.0", "zone.js": "~0.12.0" diff --git a/ng-sample/src/app/components/overlay.component.ts b/ng-sample/src/app/components/overlay.component.ts index d9e08b1..50c2b62 100644 --- a/ng-sample/src/app/components/overlay.component.ts +++ b/ng-sample/src/app/components/overlay.component.ts @@ -62,8 +62,7 @@ export class OverlayComponent implements AfterViewInit, OnDestroy { points: [ { timestamp: data.timestamp, - value: data.high, - dataIndex: dataList.length - 20, + value: data.high }, ], }); @@ -75,7 +74,7 @@ export class OverlayComponent implements AfterViewInit, OnDestroy { this.chart?.createOverlay({ name: "simpleTag", extendData: "标签标签", - points: [{ value: data.high, dataIndex: dataList.length - 10 }], + points: [{ value: data.high }], }); } diff --git a/ng-sample/src/app/components/tooltip.component.ts b/ng-sample/src/app/components/tooltip.component.ts index a3d68e0..06eb5f4 100644 --- a/ng-sample/src/app/components/tooltip.component.ts +++ b/ng-sample/src/app/components/tooltip.component.ts @@ -22,7 +22,7 @@ export class TooltipComponent implements AfterViewInit, OnDestroy { ngAfterViewInit(): void { this.chart = init('tooltip-k-line'); this.chart?.createIndicator('MA', false, { id: 'candle_pane' }); - this.chart?.createIndicator('KDJ', false, { height: 60, id: '' }); + this.chart?.createIndicator('KDJ', false, { height: 60 }); this.chart?.applyNewData(generatedDataList()); } diff --git a/react-sample/src/chart/Overlay.tsx b/react-sample/src/chart/Overlay.tsx index e3428e6..a6478fb 100644 --- a/react-sample/src/chart/Overlay.tsx +++ b/react-sample/src/chart/Overlay.tsx @@ -59,7 +59,7 @@ export default function DrawGraphMarkKLineChart () { chart.current?.createOverlay({ name: 'simpleAnnotation', extendData: '注解注解注解', - points: [{ timestamp: data.timestamp, value: data.high, dataIndex: dataList.length - 20 }] + points: [{ timestamp: data.timestamp, value: data.high }] }) }}> 内置注解 @@ -71,7 +71,7 @@ export default function DrawGraphMarkKLineChart () { chart.current?.createOverlay({ name: 'simpleTag', extendData: '标签标签', - points: [{ value: data.high, dataIndex: dataList.length - 10 }] + points: [{ value: data.high }] }) }}> 内置标签 diff --git a/react-sample/src/chart/Tooltip.tsx b/react-sample/src/chart/Tooltip.tsx index 8ee8678..f754b3b 100644 --- a/react-sample/src/chart/Tooltip.tsx +++ b/react-sample/src/chart/Tooltip.tsx @@ -48,7 +48,7 @@ export default function TooltipKLineChart () { useEffect(() => { chart.current = init('tooltip-k-line') chart.current?.createIndicator('MA', false, { id: 'candle_pane' }) - chart.current?.createIndicator('KDJ', false, { id: '', height: 80 }) + chart.current?.createIndicator('KDJ', false, { height: 80 }) chart.current?.applyNewData(generatedDataList()) return () => { dispose('tooltip-k-line') } }, []) diff --git a/vue-sample/package.json b/vue-sample/package.json index 10f5fdb..53062b9 100644 --- a/vue-sample/package.json +++ b/vue-sample/package.json @@ -9,7 +9,7 @@ "lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs --fix --ignore-path .gitignore" }, "dependencies": { - "klinecharts": "^9.0.0-alpha5", + "klinecharts": "^9.0.0-alpha6", "vue": "^3.2.45" }, "devDependencies": { diff --git a/vue-sample/src/chart/Overlay.vue b/vue-sample/src/chart/Overlay.vue index 0ce9473..3587ed6 100644 --- a/vue-sample/src/chart/Overlay.vue +++ b/vue-sample/src/chart/Overlay.vue @@ -76,8 +76,7 @@ export default { points: [ { timestamp: data.timestamp, - value: data.high, - dataIndex: dataList.length - 20, + value: data.high }, ], }); @@ -88,7 +87,7 @@ export default { this.chart.createOverlay({ name: "simpleTag", extendData: "标签标签", - points: [{ value: data.high, dataIndex: dataList.length - 10 }], + points: [{ value: data.high }], }); }, removeAllOverlay() {