1. export function zhuzhuangliti_new_consume(dom, option, click) {
    2. var barWidth = 30;
    3. var dataName = option.dataName;
    4. var dataReal = option.dataReal;
    5. var datafor1 = option.datafor1;
    6. option = {
    7. xAxis: [{
    8. formatter: '{a} <br/>{b}: {c} ({d})',
    9. axisLabel: {
    10. color: '#ffffff',
    11. textStyle: {
    12. fontSize: 12
    13. },
    14. interval: 0,
    15. },
    16. axisLine: {
    17. show: false,
    18. },
    19. axisTick: {
    20. show: false,
    21. },
    22. // data: ['一看', '而看', '三看', '进贤县', '南昌市', '是看', '南朝鲜']
    23. data: dataName
    24. }],
    25. tooltip: {
    26. trigger: 'axis',
    27. formatter: '{b}<br/>{c}',
    28. axisPointer: { // 坐标轴指示器,坐标轴触发有效
    29. type: 'shadow' // 默认为直线,可选为:'line' | 'shadow'
    30. }
    31. },
    32. grid: {
    33. top: '18%',
    34. left: option.id ? '3%' : '1.5%',
    35. right: option.id ? '3%' : '1.5%',
    36. bottom: '2%',
    37. containLabel: true
    38. },
    39. yAxis: {
    40. splitLine: {
    41. show: true,
    42. lineStyle: {
    43. color: 'rgb(76,76,76)',
    44. type: 'dashed'
    45. }
    46. },
    47. axisLine: {
    48. show: false,
    49. },
    50. axisTick: {
    51. show: false,
    52. },
    53. splitLine: {
    54. show: true,
    55. lineStyle: {
    56. color: ['#a8abad'],
    57. type: 'dashed'
    58. }
    59. },
    60. axisLabel: {
    61. textStyle: {
    62. color: option.color ? option.color : '#999'
    63. }
    64. },
    65. },
    66. series: [{
    67. z: 1,
    68. type: 'bar',
    69. barWidth: barWidth,
    70. // data: [220, 182, 191, 234, 290, 330, 310],
    71. data: dataReal,
    72. label: {
    73. show: option.id ? true : false,
    74. position: 'top',
    75. color: '#74F9FF'
    76. },
    77. itemStyle: {
    78. normal: {
    79. //线性渐变,前4个参数分别是x0,y0,x2,y2(范围0~1);相当于图形包围盒中的百分比。如果最后一个参数是‘true’,则该四个值是绝对像素位置。
    80. color: new eCharts.graphic.LinearGradient(0, 0, 0, 1, [{
    81. offset: 0,
    82. color: 'rgba(3, 210, 190, .8)'
    83. },
    84. {
    85. offset: 1,
    86. color: 'rgba(3,227,205,.5)'
    87. }
    88. ], false),
    89. }
    90. },
    91. }, {
    92. z: 2,
    93. name: '底部',
    94. type: 'pictorialBar',
    95. data: [1, 1, 1, 1, 1, 1, 1],
    96. // data: datafor1,
    97. symbol: 'diamond',
    98. symbolOffset: [0, '50%'],
    99. symbolSize: [barWidth, 10],
    100. itemStyle: {
    101. normal: {
    102. color: 'rgba(3, 210, 190, .8)'
    103. }
    104. },
    105. }, {
    106. z: 3,
    107. name: '上部1',
    108. type: 'pictorialBar',
    109. symbolPosition: 'end',
    110. //data: [1, 0, 191, 234, 290, 330, 310,1], //前两个值为0时会出现样式问题
    111. data: datafor1,
    112. symbol: 'diamond',
    113. symbolOffset: [1, '-50%'],
    114. symbolSize: [barWidth - 4, 10 * (barWidth - 4) / barWidth],
    115. itemStyle: {
    116. normal: {
    117. borderColor: 'rgba(3, 210, 190, 1)',
    118. borderWidth: 2,
    119. color: 'rgba(3, 210, 190, 1)'
    120. }
    121. },
    122. }]
    123. };
    124. setOptions(dom, option, click);
    125. }