一、echarts(4)

title     标题(大小标题)

grid       图的位置,大小等(地图的话,geo > grid)

xAxis     x坐标轴  (axisTick: x轴刻度线、splitLine: x间隙、axisLine: x轴线、axisLabel: x坐标轴刻度标签)

yAxis     y坐标轴  (axisTick: y轴刻度线、splitLine: y间隙、axisLine: y轴线、axisLabel: y坐标轴刻度标签, inverse: true(颠倒排序)

 

legend   图例组件(series有多个对象时有用)

插件 (echarts、swiper)

        selectedMode      禁止点击隐藏饼图

toolbox  工具(下载canvas图片等)

tooltip    鼠标悬停提示

 

series  各图标类型

   bar.series.label.show  展示柱状图顶部数字

color        全局颜色组

backgroundColor  全局背景颜色

textStyle      全局的字体样式

 (G2Highcharts、google echarts)

1.normal:静态的时候显示的默认样式
2.emphasis:鼠标移入动态的时候显示的默认样式
normal:{
  show:
    
  textStyle:{
    color:'red'
  }
    formatter: '{a}{c}{b} : \n{d}%',

},
emphasis:{
  color:'green'
}

 例子:

1.

ECharts

①  radar图:

  splitNumber (从圆点到最外有多少个圆圈)

  splitLine (圆圈的样式)

  axisLine (从圆点到最外直线的样式)

  splitArea (从圆点到最外圈层的样式)
  splitLine 的type只能一种,但能画两个
  插件 (echarts、swiper)
 

微信小程序版

② 饼图:
  1.中间挖空: o.series[0].radius: ["40%", "70%"] / "70%"  (镂空和不镂空)
  2.饼图排序/角度: series.hoverOffset  |  series.startAngle
  3.扇形鼠标移动的高亮和高亮偏
    series.hoverAnimation
    series.hoverOffset
自动高亮selected属性
       5. 圆心:series: [{center: ['75%', '50%'],}]
③ 折线图:
  1.刻度线朝向 xAxis.axisTick.inside: true

④ 柱状图:

  1.柱状图每个都不同颜色

插件 (echarts、swiper)
 1 series : [
 2     {
 3         type:'bar',
 4         itemStyle: {                            //  图形样式
 5             normal:{
 6                 color: function (params){
 7                     let aDataMachine1 = [];
 8                     var colorList = [];
 9                     for(let i=0; i<aDataMachine.length; i++){
10                         aDataMachine1.push(aDataMachine[i])
11                     }
12                     aDataMachine1.sort(function (a,b){
13                         return b.number-a.number
14                     });
15                     for(let i=0; i<aDataMachine.length; i++){
16                         if (aDataMachine[i].number == aDataMachine1[0].number) {
17                             colorList.push('rgb(0,255,255)');
18                         } else if(aDataMachine[i].number == aDataMachine1[1].number) {
19                             colorList.push('rgb(42,170,227)');
20                         } else {
21                             colorList.push('rgb(195,229,235)')
22                         }
23                     }
24                     return colorList[params.dataIndex];
25                 }
26             },
27         },
28     }
29 ],
View Code

相关文章:

  • 2021-12-06
  • 2021-12-06
  • 2021-12-06
  • 2019-10-06
  • 2021-09-05
  • 2022-12-23
  • 2022-12-23
  • 2021-04-19
猜你喜欢
  • 2021-12-14
  • 2021-04-28
  • 2021-06-07
  • 2021-11-19
  • 2022-12-23
  • 2021-11-19
相关资源
相似解决方案