LineOne.vue 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. <template>
  2. <view class="charts-box">
  3. <qiun-data-charts type="area" :opts="revenueOpts" :chartData="revenueChartData" />
  4. </view>
  5. </template>
  6. <script>
  7. import template_page_mixin from '@/libs/mixin/template_page_mixin.js'
  8. export default {
  9. name: 'TemplateContent',
  10. mixins: [template_page_mixin],
  11. data() {
  12. return {
  13. // 公司营收
  14. revenueChartData: {},
  15. revenueOpts: {
  16. color: ["#4B98FE"],
  17. padding: [15, 15],
  18. dataLabel: false,
  19. xAxis: {
  20. disableGrid: true,
  21. },
  22. yAxis: {
  23. // gridColor: "rgba(230,230,230,0.6)",
  24. gridColor: "rgba(200,200,200,0.6)",
  25. disabled: false,
  26. disableGrid: false,
  27. gridType: 'dash',
  28. dashLength: '4',
  29. data: [{
  30. axisLineColor: "#FFFFFF",
  31. min: 0,
  32. }],
  33. },
  34. legend: {
  35. show: false,
  36. position: "top",
  37. float: "right",
  38. },
  39. extra: {
  40. area: {
  41. type: "curve",
  42. opacity: 0.8,
  43. addLine: true,
  44. width: 1,
  45. gradient: true,
  46. },
  47. },
  48. },
  49. }
  50. },
  51. onReady() {
  52. this.drawRevenueCharts(); //公司营收
  53. },
  54. methods: {
  55. // 公司营收 绘制
  56. drawRevenueCharts() {
  57. let res = {
  58. categories: ["01-01", "", "01-08", "", "01-15", "", "01-22", "", "01-29"],
  59. series: [{
  60. name: "收入",
  61. data: [6800, 8040, 5203, 9850, 7510, 6301, 5968, 9808, 5200],
  62. legendShape: "circle",
  63. color: "#4088FE",
  64. pointShape: "none",
  65. },
  66. ],
  67. };
  68. this.revenueChartData = JSON.parse(JSON.stringify(res));
  69. },
  70. }
  71. }
  72. </script>
  73. <style lang="scss" scoped>
  74. .charts-box {
  75. width: 100%;
  76. height: 85%;
  77. }
  78. </style>