LineTwo.vue 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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(200,200,200,0.6)",
  24. disabled: false,
  25. disableGrid: false,
  26. gridType: 'dash',
  27. dashLength: '4',
  28. data: [{
  29. axisLineColor: "#FFFFFF",
  30. min: 0,
  31. }],
  32. },
  33. legend: {
  34. show: false,
  35. position: "top",
  36. float: "right",
  37. },
  38. extra: {
  39. area: {
  40. type: "curve",
  41. opacity: 0.8,
  42. addLine: true,
  43. width: 1,
  44. gradient: true,
  45. },
  46. },
  47. },
  48. }
  49. },
  50. onReady() {
  51. this.drawRevenueCharts(); //公司营收
  52. },
  53. methods: {
  54. // 公司营收 绘制
  55. drawRevenueCharts() {
  56. let res = {
  57. categories: ["01-01", "", "01-08", "", "01-15", "", "01-22", "", "01-29"],
  58. series: [{
  59. name: "收入",
  60. data: [0.1, 0.3, 0.4, 0.3, 0.6, 0.7, 0.4, 1, 0.5],
  61. legendShape: "circle",
  62. color: "#600EFF",
  63. pointShape: "none",
  64. }],
  65. };
  66. this.revenueChartData = JSON.parse(JSON.stringify(res));
  67. },
  68. }
  69. }
  70. </script>
  71. <style lang="scss" scoped>
  72. .charts-box {
  73. width: 630rpx;
  74. height: 388rpx;
  75. }
  76. </style>