diff --git a/src/chart/graph/GraphSeries.ts b/src/chart/graph/GraphSeries.ts index 51e34314b8..d6c84687af 100644 --- a/src/chart/graph/GraphSeries.ts +++ b/src/chart/graph/GraphSeries.ts @@ -106,6 +106,7 @@ export interface GraphNodeItemOption extends SymbolOptionMixin, GraphNodeStateOp category?: number | string draggable?: boolean + cursor?: string } export interface GraphEdgeStateOption { diff --git a/src/chart/graph/GraphView.ts b/src/chart/graph/GraphView.ts index 3b2d0cf3ca..37d0086927 100644 --- a/src/chart/graph/GraphView.ts +++ b/src/chart/graph/GraphView.ts @@ -150,7 +150,7 @@ class GraphView extends ChartView { } }); } - el.setDraggable(draggable && !!forceLayout); + el.setDraggable(draggable && !!forceLayout, !!itemModel.get('cursor')); const focus = itemModel.get(['emphasis', 'focus']); diff --git a/src/chart/helper/Symbol.ts b/src/chart/helper/Symbol.ts index efb45428ae..9295f306d8 100644 --- a/src/chart/helper/Symbol.ts +++ b/src/chart/helper/Symbol.ts @@ -141,10 +141,10 @@ class Symbol extends graphic.Group { symbolPath.z = z; } - setDraggable(draggable: boolean) { + setDraggable(draggable: boolean, hasCursorOption?: boolean) { const symbolPath = this.childAt(0) as ECSymbol; symbolPath.draggable = draggable; - symbolPath.cursor = draggable ? 'move' : symbolPath.cursor; + symbolPath.cursor = !hasCursorOption && draggable ? 'move' : symbolPath.cursor; } /** diff --git a/test/graph-symbol.html b/test/graph-symbol.html index 61f9276fe5..0c023aca01 100644 --- a/test/graph-symbol.html +++ b/test/graph-symbol.html @@ -81,6 +81,8 @@ }, } }, + draggable: true, + cursor: 'help', force: { repulsion: 1000 },