• echarts和v-chart柱状图颜色渐变


    echarts柱状图颜色渐变

    1. series: [
    2. {
    3. type: 'bar',
    4. barWidth: 10,
    5. stack: 'total',
    6. data: this.seriesData,
    7. itemStyle: {
    8. normal: {
    9. color: new echarts.graphic.LinearGradient(1, 0, 0, 0, [{
    10. offset: 0,
    11. color: '#4d76ff'
    12. }, {
    13. offset: 1,
    14. color: '#80aaff'
    15. }]),
    16. }
    17. },
    18. }
    19. ],

    v-chart柱状图颜色渐变

    1. {
    2. name: '当月耗电量',
    3. type: 'bar',
    4. itemStyle: {
    5. color: {
    6. type: 'linear',
    7. x: 0,
    8. y: 0,
    9. x2: 0,
    10. y2: 1,
    11. colorStops: [
    12. {
    13. offset: 0,
    14. color: '#00e3fa',
    15. },
    16. {
    17. offset: 1,
    18. color: 'rgba(13,44,58,0.50)',
    19. },
    20. ],
    21. },
    22. },
    23. yAxisIndex: 1,
    24. data: [2.0, 2.2, 3.3, 4.5, 6.3, 10.2, 20.3, 23.4, 23.0, 16.5, 12.0, 6.2]
    25. }
    1. chargeBoxOption: {
    2. color: ['#5470C6', '#EE6666'],
    3. tooltip: {
    4. trigger: 'axis',
    5. axisPointer: {
    6. type: 'cross'
    7. }
    8. },
    9. grid: {
    10. right: '20%'
    11. },
    12. // toolbox: {
    13. // feature: {
    14. // dataView: { show: true, readOnly: false },
    15. // restore: { show: true },
    16. // saveAsImage: { show: true }
    17. // }
    18. // },
    19. legend: {
    20. data: ['累计耗电量', '当月耗电量'],
    21. textStyle: {
    22. color: '#fff',
    23. },
    24. bottom: '10px',
    25. },
    26. xAxis: [
    27. {
    28. type: 'category',
    29. axisTick: {
    30. alignWithLabel: true
    31. },
    32. // prettier-ignore
    33. data: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月']
    34. }
    35. ],
    36. yAxis: [
    37. {
    38. type: 'value',
    39. name: '累计耗电量',
    40. position: 'right',
    41. alignTicks: true,
    42. axisLine: {
    43. show: true,
    44. lineStyle: {
    45. color: '#fff',
    46. }
    47. },
    48. // axisLabel: {
    49. // formatter: '{value} ml'
    50. // }
    51. },
    52. {
    53. type: 'value',
    54. name: '当月耗电量',
    55. position: 'left',
    56. alignTicks: true,
    57. axisLine: {
    58. show: true,
    59. lineStyle: {
    60. color: '#fff',
    61. }
    62. },
    63. // axisLabel: {
    64. // formatter: '{value} °C'
    65. // }
    66. }
    67. ],
    68. series: [
    69. {
    70. name: '累计耗电量',
    71. type: 'line',
    72. yAxisIndex: 0,
    73. itemStyle: {
    74. color: '#FF6A29'
    75. },
    76. data: [
    77. 2.0, 4.9, 7.0, 23.2, 25.6, 76.7, 135.6, 162.2, 32.6, 20.0, 6.4, 3.3
    78. ]
    79. },
    80. {
    81. name: '当月耗电量',
    82. type: 'bar',
    83. itemStyle: {
    84. color: {
    85. type: 'linear',
    86. x: 0,
    87. y: 0,
    88. x2: 0,
    89. y2: 1,
    90. colorStops: [
    91. {
    92. offset: 0,
    93. color: '#00e3fa',
    94. },
    95. {
    96. offset: 1,
    97. color: 'rgba(13,44,58,0.50)',
    98. },
    99. ],
    100. },
    101. },
    102. yAxisIndex: 1,
    103. data: [2.0, 2.2, 3.3, 4.5, 6.3, 10.2, 20.3, 23.4, 23.0, 16.5, 12.0, 6.2]
    104. }
    105. ]
    106. }

  • 相关阅读:
    R语言使用data.table包的fread函数读取(加载)csv数据为data.table格式、使用anyNA函数判断data.table中是否存在缺失值
    5 分钟理解 Next.js Static Export
    LQ0150 回文日期【枚举】
    【算法与数据结构】--常见数据结构--树与图
    Docker Compose安装
    关于JSON对象和前端js对象
    Redis Lua Java 随机编号 用户编号
    MySQL:完整性约束和 表的设计原则
    生态保护促进经济效益-国稻种芯-万祥军:青海西宁现代农业
    Linux系统(CentOS7)上安装MYSQL8.x
  • 原文地址:https://blog.csdn.net/killerdoubie/article/details/133862129