Echarts5之symbolSize的大小设置
in Echarts with 1 comment
Echarts5之symbolSize的大小设置
in Echarts with 1 comment

symbolSize number, Array, Function

[ default: 4 ]

标记的大小,可以设置成诸如 10 这样单一的数字,也可以用数组分开表示宽和高,例如 [20, 10] 表示标记宽为20,高为10。

如果需要每个数据的图形大小不一样,可以设置为如下格式的回调函数:

(value: Array|number, params: Object) => number|Array
其中第一个参数 value 为 data 中的数据值。第二个参数params 是其它的数据项参数。

所以symbolSize可以全局设置和局部设置两种方式,值的设置方式有两种,单值和双值的形式。

指的方式:

1.单值形式:symbolSize: 4

2.双值形式:symbolSize: 【3,4】 (宽高)

数据的设置的方式区分全局和局部

1.全局

series: {
     symbolSize: 4

}

2.局部

方法一:在data的每一项中去设置 symbolSize

series: [{
        data: [{value: 820, symbolSize: 0}, {value: 820, symbolSize: 10}],
        symbol:'circle',
        smooth: true
    }]
};

方法二  使用回调函数

var size = [16,0,0,0,8]
 
series: [{
         data: [ 820,820,800,900,780,500],
        symbol:'circle',
        symbolSize:(rawValue, params) => {
            params.symbolSize = size[params.dataIndex]
            return params.symbolSize
        },
        type: 'line',
        smooth: true
    }]

效果图:
1
通俗点就是表标记点的大小进行改变


Deprecated: array_key_exists(): Using array_key_exists() on objects is deprecated. Use isset() or property_exists() instead in /www/wwwroot/ae.lcean.com/usr/themes/pinghsu-master/post.php on line 109

Deprecated: array_key_exists(): Using array_key_exists() on objects is deprecated. Use isset() or property_exists() instead in /www/wwwroot/ae.lcean.com/usr/themes/pinghsu-master/post.php on line 111

Deprecated: array_key_exists(): Using array_key_exists() on objects is deprecated. Use isset() or property_exists() instead in /www/wwwroot/ae.lcean.com/usr/themes/pinghsu-master/post.php on line 113

Deprecated: array_key_exists(): Using array_key_exists() on objects is deprecated. Use isset() or property_exists() instead in /www/wwwroot/ae.lcean.com/usr/themes/pinghsu-master/post.php on line 115

Deprecated: array_key_exists(): Using array_key_exists() on objects is deprecated. Use isset() or property_exists() instead in /www/wwwroot/ae.lcean.com/usr/themes/pinghsu-master/post.php on line 117

Deprecated: array_key_exists(): Using array_key_exists() on objects is deprecated. Use isset() or property_exists() instead in /www/wwwroot/ae.lcean.com/usr/themes/pinghsu-master/post.php on line 119

Deprecated: array_key_exists(): Using array_key_exists() on objects is deprecated. Use isset() or property_exists() instead in /www/wwwroot/ae.lcean.com/usr/themes/pinghsu-master/post.php on line 121

Deprecated: array_key_exists(): Using array_key_exists() on objects is deprecated. Use isset() or property_exists() instead in /www/wwwroot/ae.lcean.com/usr/themes/pinghsu-master/post.php on line 123

Deprecated: array_key_exists(): Using array_key_exists() on objects is deprecated. Use isset() or property_exists() instead in /www/wwwroot/ae.lcean.com/usr/themes/pinghsu-master/post.php on line 125

Deprecated: array_key_exists(): Using array_key_exists() on objects is deprecated. Use isset() or property_exists() instead in /www/wwwroot/ae.lcean.com/usr/themes/pinghsu-master/post.php on line 127

Deprecated: array_key_exists(): Using array_key_exists() on objects is deprecated. Use isset() or property_exists() instead in /www/wwwroot/ae.lcean.com/usr/themes/pinghsu-master/post.php on line 109

Deprecated: array_key_exists(): Using array_key_exists() on objects is deprecated. Use isset() or property_exists() instead in /www/wwwroot/ae.lcean.com/usr/themes/pinghsu-master/post.php on line 111

Deprecated: array_key_exists(): Using array_key_exists() on objects is deprecated. Use isset() or property_exists() instead in /www/wwwroot/ae.lcean.com/usr/themes/pinghsu-master/post.php on line 113

Deprecated: array_key_exists(): Using array_key_exists() on objects is deprecated. Use isset() or property_exists() instead in /www/wwwroot/ae.lcean.com/usr/themes/pinghsu-master/post.php on line 115

Deprecated: array_key_exists(): Using array_key_exists() on objects is deprecated. Use isset() or property_exists() instead in /www/wwwroot/ae.lcean.com/usr/themes/pinghsu-master/post.php on line 117

Deprecated: array_key_exists(): Using array_key_exists() on objects is deprecated. Use isset() or property_exists() instead in /www/wwwroot/ae.lcean.com/usr/themes/pinghsu-master/post.php on line 119

Deprecated: array_key_exists(): Using array_key_exists() on objects is deprecated. Use isset() or property_exists() instead in /www/wwwroot/ae.lcean.com/usr/themes/pinghsu-master/post.php on line 121

Deprecated: array_key_exists(): Using array_key_exists() on objects is deprecated. Use isset() or property_exists() instead in /www/wwwroot/ae.lcean.com/usr/themes/pinghsu-master/post.php on line 123

Deprecated: array_key_exists(): Using array_key_exists() on objects is deprecated. Use isset() or property_exists() instead in /www/wwwroot/ae.lcean.com/usr/themes/pinghsu-master/post.php on line 125

Deprecated: array_key_exists(): Using array_key_exists() on objects is deprecated. Use isset() or property_exists() instead in /www/wwwroot/ae.lcean.com/usr/themes/pinghsu-master/post.php on line 127
Responses / Cancel Reply
  1. 1

    ::(OK)::(沙发)::(手纸)::(香蕉)::(便便)::(药丸)::(红领巾)::(蜡烛)::(音乐)::(灯泡)::(开心)::(钱)::(咦)::(呼)::(冷)::(生气)::(弱)::(狗头):@(喜极而泣):@(抽烟):@(不出所料):@(愤怒):@(无奈):@(黑线):@(投降):@(看热闹):@(扇耳光):@(小眼睛):@(中刀)::(呵呵)::(哈哈)::(吐舌)::(太开心)::(笑眼)::(花心)::(小乖)::(乖)::(捂嘴笑)::(滑稽)::(你懂的)::(不高兴)::(怒)::(汗)::(黑线)::(泪)::(真棒)::(喷)::(惊哭)::(阴险)::(鄙视)::(酷)::(啊)::(狂汗)::(what)::(疑问)::(酸爽)::(呀咩爹)::(委屈)::(惊讶)::(睡觉)::(笑尿)::(挖鼻)::(吐)::(犀利)::(小红脸)::(懒得理)::(勉强)::(爱心)::(心碎)::(玫瑰)::(礼物)::(彩虹)::(太阳)::(星星月亮)::(钱币)::(茶杯)::(蛋糕)::(大拇指)::(胜利)::(haha):@(高兴):@(小怒):@(脸红):@(内伤):@(装大款):@(赞一个):@(害羞):@(汗):@(吐血倒地):@(深思):@(不高兴):@(无语):@(亲亲):@(口水):@(尴尬):@(中指):@(想一想):@(哭泣):@(便便):@(献花):@(皱眉):@(傻笑):@(狂汗):@(吐):@(喷水):@(看不见):@(鼓掌):@(阴暗):@(长草):@(献黄瓜):@(邪恶):@(期待):@(得意):@(吐舌):@(喷血):@(无所谓):@(观察):@(暗地观察):@(肿包):@(中枪):@(大囧):@(呲牙):@(抠鼻):@(不说话):@(咽气):@(欢呼):@(锁眉):@(蜡烛):@(坐等):@(击掌):@(惊喜)|´・ω・)ノヾ(≧∇≦*)ゝ(☆ω☆)(╯‵□′)╯︵┴─┴ ̄﹃ ̄(/ω\)∠( ᐛ 」∠)_(๑•̀ㅁ•́ฅ)→_→୧(๑•̀⌄•́๑)૭٩(ˊᗜˋ*)و(ノ°ο°)ノ(´இ皿இ`)⌇●﹏●⌇(ฅ´ω`ฅ)(╯°A°)╯︵○○○φ( ̄∇ ̄o)ヾ(´・ ・`。)ノ( ง ᵒ̌皿ᵒ̌)ง⁼³₌₃(ó﹏ò。)Σ(っ °Д °;)っ( ,,´・ω・)ノ╮(╯▽╰)╭ o(*////▽////*)q >﹏<( ๑´•ω•) (。•ˇ‸ˇ•。)::(呵呵)::(哈哈)::(吐舌)::(太开心)::(笑眼)::(花心)::(小乖)::(乖)::(捂嘴笑)::(滑稽)::(你懂的)::(不高兴)::(怒)::(汗)::(黑线)::(泪)::(真棒)::(喷)::(惊哭)::(阴险)::(鄙视)::(酷)::(啊)::(狂汗)::(what)::(疑问)::(酸爽)::(呀咩爹)::(委屈)::(惊讶)::(睡觉)::(笑尿)::(挖鼻)::(吐)::(犀利)::(小红脸)::(懒得理)::(勉强)::(爱心)::(心碎)::(玫瑰)::(礼物)::(彩虹)::(太阳)::(星星月亮)::(钱币)::(茶杯)::(蛋糕)::(大拇指)::(胜利)::(haha)::(OK)::(沙发)::(手纸)::(香蕉)::(便便)::(药丸)::(红领巾)::(蜡烛)::(音乐)::(灯泡)::(开心)::(钱)::(咦)::(呼)::(冷)::(生气)::(弱)::(狗头):@(高兴):@(小怒):@(脸红):@(内伤):@(装大款):@(赞一个):@(害羞):@(汗):@(吐血倒地):@(深思):@(不高兴):@(无语):@(亲亲):@(口水):@(尴尬):@(中指):@(想一想):@(哭泣):@(便便):@(献花):@(皱眉):@(傻笑):@(狂汗):@(吐):@(喷水):@(看不见):@(鼓掌):@(阴暗):@(长草):@(献黄瓜):@(邪恶):@(期待):@(得意):@(吐舌):@(喷血):@(无所谓):@(观察):@(暗地观察):@(肿包):@(中枪):@(大囧):@(呲牙):@(抠鼻):@(不说话):@(咽气):@(欢呼):@(锁眉):@(蜡烛):@(坐等):@(击掌):@(惊喜):@(喜极而泣):@(抽烟):@(不出所料):@(愤怒):@(无奈):@(黑线):@(投降):@(看热闹):@(扇耳光):@(小眼睛):@(中刀)

    Reply