diff --git a/package.json b/package.json index b2ea0f9636..b8e8052986 100644 --- a/package.json +++ b/package.json @@ -58,7 +58,7 @@ "mktest": "node test/build/mktest.js", "mktest:help": "node test/build/mktest.js -h", "checktype": "tsc --noEmit", - "lint": "npx eslint src/**/*.ts extension-src/**/*.ts", + "lint": "npx eslint --cache --cache-location node_modules/.cache/eslint src/**/*.ts extension-src/**/*.ts", "lint:fix": "npx eslint --fix src/**/*.ts extension-src/**/*.ts", "lint:dist": "echo 'It might take a while. Please wait ...' && npx jshint --config .jshintrc-dist dist/echarts.js" }, diff --git a/src/label/LabelManager.ts b/src/label/LabelManager.ts index c1c7d91527..f2b2aefd36 100644 --- a/src/label/LabelManager.ts +++ b/src/label/LabelManager.ts @@ -487,10 +487,11 @@ class LabelManager { const defaultStyle: PathStyleProps = {}; const visualStyle = data.getItemVisual(dataIndex, 'style'); - const visualType = data.getVisual('drawType'); - // Default to be same with main color - defaultStyle.stroke = visualStyle[visualType]; - + if (visualStyle) { + const visualType = data.getVisual('drawType'); + // Default to be same with main color + defaultStyle.stroke = visualStyle[visualType]; + } const labelLineModel = itemModel.getModel('labelLine'); setLabelLineStyle(el, getLabelLineStatesModels(itemModel), defaultStyle); @@ -591,4 +592,5 @@ class LabelManager { } -export default LabelManager; \ No newline at end of file +export default LabelManager; + diff --git a/test/graph-case.html b/test/graph-case.html index e6d311b41c..7f199f5a4a 100644 --- a/test/graph-case.html +++ b/test/graph-case.html @@ -38,7 +38,7 @@
- +
@@ -95,6 +95,64 @@ }); + diff --git a/test/runTest/actions/__meta__.json b/test/runTest/actions/__meta__.json index b1cc9c96a4..9f6155e613 100644 --- a/test/runTest/actions/__meta__.json +++ b/test/runTest/actions/__meta__.json @@ -100,6 +100,7 @@ "geoScatter": 1, "getOption": 1, "graph": 2, + "graph-case": 1, "graph-grid": 1, "graph-simple": 2, "graphic-animation": 1, diff --git a/test/runTest/actions/graph-case.json b/test/runTest/actions/graph-case.json new file mode 100644 index 0000000000..ace16dc419 --- /dev/null +++ b/test/runTest/actions/graph-case.json @@ -0,0 +1 @@ +[{"name":"Action 1","ops":[{"type":"mousemove","time":475,"x":416,"y":188},{"type":"mousemove","time":675,"x":406,"y":208},{"type":"mousedown","time":848,"x":406,"y":210},{"type":"mousemove","time":881,"x":406,"y":210},{"type":"mouseup","time":979,"x":406,"y":210},{"time":980,"delay":400,"type":"screenshot-auto"},{"type":"mousedown","time":1837,"x":406,"y":210},{"type":"mouseup","time":1988,"x":406,"y":210},{"time":1989,"delay":400,"type":"screenshot-auto"},{"type":"mousemove","time":2341,"x":406,"y":211},{"type":"mousemove","time":2541,"x":415,"y":180}],"scrollY":334,"scrollX":0,"timestamp":1684056156749}] \ No newline at end of file