column4.js 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. layui.use(['echarts'], function() {
  2. let echarts = layui.echarts;
  3. var column4 = echarts.init(document.getElementById('column4'),null, {
  4. width: 600,
  5. height: 400
  6. });
  7. option = {
  8. backgroundColor:'#fff',
  9. title:{
  10. text:"描边柱状图",
  11. top:10,
  12. left:15,
  13. color:"#35598d",
  14. fontSize:16,
  15. fontWeight:'normal'
  16. },
  17. tooltip: {
  18. trigger: 'axis',
  19. formatter:'{b}:{c}',
  20. },
  21. grid: {
  22. left: '5%',
  23. right: '6%',
  24. bottom: '3%',
  25. top: '20%',
  26. containLabel: true
  27. },
  28. xAxis :{
  29. type : 'category',
  30. data : ['策略1','策略2','策略3','策略4','策略5','策略6','策略7','策略8','策略9'],
  31. axisLabel:{ //坐标轴字体颜色
  32. color: '#9eaaba'
  33. },
  34. axisLine:{
  35. lineStyle:{
  36. color:"#e5e5e5"
  37. }
  38. },
  39. axisTick:{ //y轴刻度线
  40. show:false
  41. },
  42. splitLine:{ //网格
  43. show: false,
  44. }
  45. },
  46. yAxis :{
  47. type : 'value',
  48. axisLabel:{ //坐标轴字体颜色
  49. color: '#9eaaba'
  50. },
  51. axisLine:{
  52. show:false,
  53. },
  54. axisTick:{ //y轴刻度线
  55. show:false
  56. },
  57. splitLine:{ //网格
  58. show: true,
  59. lineStyle:{
  60. color:'#dadde4',
  61. type:"dashed" //坐标网线类型
  62. }
  63. }
  64. },
  65. series:{
  66. name:'',
  67. type:'bar',
  68. barWidth : '40%', //柱子宽度
  69. itemStyle:{ //柱子颜色
  70. borderWidth: 2,
  71. borderColor: 'rgb(79, 116, 223)',
  72. color:'rgba(79, 116, 223, .3)',
  73. },
  74. data:[320, 332, 301, 334, 390, 330, 320, 230, 156]
  75. }
  76. };
  77. column4.setOption(option);
  78. window.onresize = function() {
  79. column4.resize();
  80. }
  81. })