圖例組件:存在多個圖形時使用 控制顯示/不顯示的圖形
圖例數(shù)據(jù)?data
使用通用樣式: 數(shù)組形式 data:["name1","name2","name3"]
獨立設(shè)置樣式:數(shù)組對象形式?
可為每個項設(shè)置私有textStyle
data:[{
? ? ? ? ? ? ? ? ? ? ?name:"legend1",
? ? ? ? ? ? ? ? ? ? ?icon:"rect",
? ? ? ? ? ? ? ? ? ? ?textStyle:{
? ? ? ? ? ? ? ? ? ? ?color:"green"
? ? ? ? ? ? ? ? ? ? ?}
},{ },{ }]
圖例公用文本樣式??textStyle
組件類型?type
plain 普通
scroll 滾動(圖例數(shù)量多的時候使用)? 會進行分頁
設(shè)置組件相對位置?left,top,bottom,right
number類型? ?類似于position:absolute;
布局朝向?orient
'horizontal'水平方向? 'vertical'垂直方向
垂直布局時的對齊方式?align :? auto left right
圖標(biāo)類型? ?icon
?'circle',?'rect',?'roundRect',?'triangle',?'diamond',?'pin',?'arrow',?'none'
也可以自定義圖標(biāo)?'image://url'
是否保持圖標(biāo)長寬比 symbolKeepAspect?圖標(biāo)為自定義時生效
項之間的間隔??itemGap
圖例組件左邊圖標(biāo)的寬高?itemWidth? itemHeight
格式化圖例文本?formatter
?//字符模板方式? ?
formatter: 'Legend {name}'
?// 使用回調(diào)函數(shù)
formatter: function(name){
? ? ? ? ? return 'Legend ' + name;
}
? ?{{{{{{{{{{emphasis }}}}}}}}}? ???高亮的樣式?
圖例的提示框? tooltip??
?一般是圖例的文字比較多的時候用
圖例關(guān)閉時的顏色inactiveColor
zlevel: 用于canvas分層 暫未使用過
圖例選擇模式?selectedMode
?true 開啟? false 關(guān)閉? single 單選?multiple多選
是否選中狀態(tài)表? selected
默認是全部選中
selected?:{"text1":true,"text2":false}??
圖例組件組件樣式
內(nèi)邊距?padding
背景顏色?backgroundColor
邊框
? ? ? borderColors邊框顏色
? ? ? borderRadius邊框圓角
? ? ? borderWidth?邊框?qū)挾?/p>
陰影?
? ? shadowBlur? 模糊大小 number
? ? shadowColor 顏色
? ? shadowOffsetX 水平偏移
? ? shadowOffsetY 垂直偏移
全選/全不選按鈕 選擇器??
是否開啟選擇器 selector? ? ? ? ? ?
? ? ? ? ? ? ? ? ? ? ? ? ? ?true false
選擇器文本標(biāo)簽樣式??selectorLabel
選擇器位置 selectorPosition? ? ?
? ? ? ? ? ? ? ? ? ?auto? start end?
選擇器按鈕間隔? selectorTtemGap? ? number
選擇器與圖例組件之間間隔 selectorButtonGap? ? number
當(dāng)type為scroll滾動時可進行的設(shè)置
當(dāng)前圖例位置??scrollDataIndex 第幾頁
圖例按鈕和圖形間距pageButtonItemGap
圖例按鈕和分頁按鈕間距type:'scroll' 時生效? pageButtonGap
翻頁按鈕圖標(biāo)?pageIcon
? ? ? ? ? ? ?horizontal:[ 'image://url',?'image://url'?] 橫向時的分頁按鈕圖標(biāo)
? ? ? ? ? ? ?vertical : [?'image://url',?'image://url'?]縱向時的分頁按鈕圖標(biāo)
分頁按鈕顏色??pageIconColor
翻頁到頭的顏色?pageIconInactiveColor
分頁按鈕大小pageIconSize
分頁文字樣式?pageTextStyle
翻頁時是否使用動畫animation true false
動畫持續(xù)時間animationDurationUpdate 毫秒數(shù)
