echarts地图设置随内容的多少而变化颜色

echarts地图设置随内容的多少而变化颜色,第1张

我用的是finereport,这个超级简单啊,选中地图,点击图表属性表-样式>系列可修改值区间以及配色方案。不知道你用的这个是不是,楼主你这样看看你的能行不 不知道能不能解决,楼主试试finereport,处理地图什么的超级方便,网上有版,楼主可以自echarts地图设置随内容的多少而变化颜色

官方文档里面好像没有这个API

默认的tooltip不是canvas而是div;

所以直接在formatter里面添加span设置好颜色就可以了

tooltip: {

trigger: 'axis',

formatter: '

}

name:"邮件营销",

tooltip:{

    formatter: "{b}<br/><font color='red'>{a}</font>:{c}"

}

在series数组里面的子对象中加入tooltip属性就可以了里面可以自定你的提示样式

<!DOCTYPE html>

<html lang="en">

<head>

<meta charset="UTF-8">

<title>Title</title>

<script src="echarts-alljs"></script>

<style>

aaa{

width: 500px;

height: 500px;

}

</style>

</head>

<body>

<div class="aaa" id="annular"></div>

<script>

var aaa = echartsinit(documentgetElementById('annular'));

option = {

title: {

x: 'center',

text: 'ECharts例子个数统计'

},

tooltip: {

trigger: 'item'

},

legend:{

//selectedMode: false,

x:'right',

y:70,

align:'right',

itemWidth:16,

itemGap:20,

orient:'vertical',

data:[{name:'消',textStyle:{color:'#C1232B'}},

{name:'现',textStyle:{color:'#B5C334'}},

{name:'教',textStyle:{color:'#FCCE10'}}

],

selected:{

'消':true,

'现':true,

'教':true

}

},

color:['#C1232B','#B5C334','#FCCE10'],

toolbox: {

show: true,

feature: {

dataView: {show: true, readOnly: false},

restore: {show: true},

saveAsImage: {show: true}

}

},

calculable: true,

grid: {

borderWidth: 0,

y: 80,

y2: 60

},

xAxis: [

{

type: 'category',

show: false,

data: ['消', '现', '教']

}

],

yAxis: [

{

type: 'value',

show: false

}

],

series: [

{

name: 'ECharts例子个数统计',

type: 'bar',

itemStyle: {

normal: {

color: function(params) {

// build a color map as your need

var colorList = [

'#C1232B','#B5C334','#FCCE10','#E87C25','#27727B',

'#FE8463','#9BCA63','#FAD860','#F3A43B','#60C0DD',

'#D7504B','#C6E579','#F4E001','#F0805A','#26C0C0'

];

return colorList[paramsdataIndex]

},

label: {

show: true,

position: 'top',

formatter: '{b}\n{c}'

}

}

},

data: [12,21,10],

markPoint: {

tooltip: {

trigger: 'item',

backgroundColor: 'rgba(0,0,0,0)'

},

data: [

{xAxis:0, y: 350, name:'Line', symbolSize:20, symbol:'none'},

{xAxis:1, y: 350, name:'Bar', symbolSize:20,symbol:'none'},

{xAxis:2, y: 350, name:'Scatter', symbolSize:20,symbol:'none'}

]

}

}

]

};

aaasetOption(option);

</script>

</body>

</html>

以上就是关于echarts地图设置随内容的多少而变化颜色全部的内容,包括:echarts地图设置随内容的多少而变化颜色、echarts tooltip 自定义formatter怎么设置颜色、echarts 中改变name属性的颜色等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/web/9463060.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2023-04-28
下一篇2023-04-28

发表评论

登录后才能评论

评论列表(0条)

    保存