新聞中心
xAxis.axisPointer.lineStyle | Object
對 xAxis 中對 axisPointer 線的樣式進行設置。

成都創(chuàng)新互聯(lián)公司是創(chuàng)新、創(chuàng)意、研發(fā)型一體的綜合型網(wǎng)站建設公司,自成立以來公司不斷探索創(chuàng)新,始終堅持為客戶提供滿意周到的服務,在本地打下了良好的口碑,在過去的10年時間我們累計服務了上千家以及全國政企客戶,如柔性防護網(wǎng)等企業(yè)單位,完善的項目管理流程,嚴格把控項目進度與質量監(jiān)控加上過硬的技術實力獲得客戶的一致表揚。
注意:當 axisPointer.type 為 'line' 時有效。xAxis.axisPointer.lineStyle.color | Color
[ default: #555 ]
設置 axisPointer 線的顏色。
顏色可以使用 RGB 表示,比如 'rgb(128, 128, 128)',如果想要加上 alpha 通道表示不透明度,可以使用 RGBA,比如 'rgba(128, 128, 128, 0.5)',也可以使用十六進制格式,比如 '#ccc'。除了純色之外顏色也支持漸變色和紋理填充
// 線性漸變,前四個參數(shù)分別是 x0, y0, x2, y2, 范圍從 0 - 1,相當于在圖形包圍盒中的百分比,如果 globalCoord 為 `true`,則該四個值是絕對的像素位置
color: {
type: 'linear',
x: 0,
y: 0,
x2: 0,
y2: 1,
colorStops: [{
offset: 0, color: 'red' // 0% 處的顏色
}, {
offset: 1, color: 'blue' // 100% 處的顏色
}],
globalCoord: false // 缺省為 false
}
// 徑向漸變,前三個參數(shù)分別是圓心 x, y 和半徑,取值同線性漸變
color: {
type: 'radial',
x: 0.5,
y: 0.5,
r: 0.5,
colorStops: [{
offset: 0, color: 'red' // 0% 處的顏色
}, {
offset: 1, color: 'blue' // 100% 處的顏色
}],
globalCoord: false // 缺省為 false
}
// 紋理填充
color: {
image: imageDom, // 支持為 HTMLImageElement, HTMLCanvasElement,不支持路徑字符串
repeat: 'repeat' // 是否平鋪, 可以是 'repeat-x', 'repeat-y', 'no-repeat'
}xAxis.axisPointer.lineStyle.width | number
[ default: 1 ]
設置 axisPointer 線的寬度。
xAxis.axisPointer.lineStyle.type | string
[ default: solid ]
設置 axisPointer 線的類型。
可選:
- 'solid'
- 'dashed'
- 'dotted'
xAxis.axisPointer.lineStyle.shadowBlur | number
設置 axisPointer 中圖形陰影的模糊大小。
該屬性配合 shadowColor,shadowOffsetX,shadowOffsetY 一起設置圖形的陰影效果。
示例:
{
shadowColor: 'rgba(0, 0, 0, 0.5)',
shadowBlur: 10
}xAxis.axisPointer.lineStyle.shadowColor | Color
設置 axisPointer 的陰影顏色。
xAxis.axisPointer.lineStyle.shadowOffsetX | number
[ default: 0 ]
設置 axisPointer 陰影在水平方向上的偏移距離。
xAxis.axisPointer.lineStyle.shadowOffsetY | number
[ default: 0 ]
設置 axisPointer 陰影在垂直方向上的偏移距離。
xAxis.axisPointer.lineStyle.opacity | number
設置 axisPointer 圖形的透明度。支持從 0 到 1 的數(shù)字,為 0 時不繪制該圖形。
新聞標題:創(chuàng)新互聯(lián)ECharts教程:xAxis設置坐標軸指示器的線條樣式
轉載來源:http://fisionsoft.com.cn/article/djpehhe.html


咨詢
建站咨詢
