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 @@ }); +