WaterLevelChart.vue 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. <template>
  2. <div style="display: inline-block;float:left">
  3. <jt-echarts style="width: 166rem;height: 166rem;margin:10rem" :chartData="option"></jt-echarts>
  4. </div>
  5. <div class="text">
  6. 123123
  7. </div>
  8. </template>
  9. <script>
  10. export default {
  11. data() {
  12. return {
  13. option: {}
  14. }
  15. },
  16. created() {},
  17. mounted() {
  18. this.typeCharts0()
  19. },
  20. methods: {
  21. typeCharts0() {
  22. this.option = this.getOption();
  23. // var chartDom = document.getElementById('echarts');
  24. // var myChart = echarts.init(chartDom);
  25. // myChart.setOption(option, true);
  26. },
  27. getOption(data) {
  28. let option = {
  29. tooltip: {
  30. show: true
  31. },
  32. series: [{
  33. name: '睡了',
  34. type: 'liquidFill',
  35. radius: '160rem',
  36. data: [0.6],
  37. label: {
  38. normal: {
  39. color: '#27e5f1',
  40. insideColor: '#fff',
  41. textStyle: {
  42. fontSize: 40,
  43. fontWeight: 'bold',
  44. }
  45. }
  46. },
  47. color: [{
  48. type: 'linear',
  49. x: 0,
  50. y: 1,
  51. x2: 0,
  52. y2: 0,
  53. colorStops: [{
  54. offset: 1,
  55. color: ['#6a7feb'], // 0% 处的颜色
  56. }, {
  57. offset: 0,
  58. color: ['#27e5f1'], // 100% 处的颜色
  59. }],
  60. global: false // 缺省为 false
  61. }],
  62. outline: {
  63. show: true,
  64. borderDistance: 5,
  65. itemStyle: {
  66. borderColor: '#27e5f1',
  67. borderWidth: 3
  68. }
  69. }
  70. }]
  71. };
  72. return option;
  73. }
  74. },
  75. }
  76. </script>
  77. <style>
  78. .text{
  79. height:160rem;
  80. width:160rem;
  81. background-color: red;
  82. display: inline-block;
  83. }
  84. </style>