顯示和隱藏ECharts提示框

2018-09-20 15:36 更新

action.tooltip  |  *

提示框組件相關(guān)的行為,必須引入提示框組件后才能使用。

action.tooltip.showTip  |  Action

顯示提示框。

有下面兩種使用方式。

1 指定在相對容器的位置處顯示提示框,如果指定的位置無法顯示則無效。

dispatchAction({
type: 'showTip',
// 屏幕上的 x 坐標(biāo)
x: number,
// 屏幕上的 y 坐標(biāo)
y: number,
// 本次顯示 tooltip 的位置。只在本次 action 中生效。
// 缺省則使用 option 中定義的 tooltip 位置。
position: Array.<number>|string|Function
})

2 指定數(shù)據(jù)圖形,根據(jù) tooltip 的配置項(xiàng)顯示提示框。

dispatchAction({
type: 'showTip',
// 系列的 index,在 tooltip 的 trigger 為 axis 的時候可選。
seriesIndex?: number,
// 數(shù)據(jù)的 index,如果不指定也可以通過 name 屬性根據(jù)名稱指定數(shù)據(jù)
dataIndex?: number,
// 可選,數(shù)據(jù)名稱,在有 dataIndex 的時候忽略
name?: string,
// 本次顯示 tooltip 的位置。只在本次 action 中生效。
// 缺省則使用 option 中定義的 tooltip 位置。
position: Array.<number>|string|Function,
})

參數(shù)position同tooltip.position相同。

action.tooltip.hideTip  |  Action

隱藏提示框。

dispatchAction({
type: 'hideTip'
})
以上內(nèi)容是否對您有幫助:
在線筆記
App下載
App下載

掃描二維碼

下載編程獅App

公眾號
微信公眾號

編程獅公眾號