index.vue 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <!-- 地图页面 -->
  2. <template>
  3. <view>
  4. <highcharts :chartOptions="options" :styles="styles" ref="simpleChart"></highcharts>
  5. </view>
  6. </template>
  7. <script>
  8. import highcharts from "@/components/highcharts/highcharts"
  9. export default {
  10. data() {
  11. return {
  12. options: {
  13. chart: {
  14. type: 'spline' //指定图表的类型,默认是折线图(line)
  15. },
  16. title: {
  17. text: '我的第一个图表' // 标题
  18. },
  19. xAxis: {
  20. type: 'datetime',
  21. crosshair: true, //十字基准线
  22. dateTimeLabelFormats: {
  23. //根据时间间距X轴自动显示哪种格式
  24. millisecond: "%H:%M:%S.%L",
  25. second: "%H:%M:%S",
  26. minute: "%H:%M",
  27. hour: "%H:%M",
  28. day: "%m-%d",
  29. week: "%m-%d",
  30. month: "%Y-%m",
  31. year: "%Y",
  32. },
  33. },
  34. yAxis: {
  35. title: {
  36. text: '吃水果个数' // y 轴标题
  37. }
  38. },
  39. series:[{
  40. data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4],
  41. // pointStart: Date.UTC(2010, 0, 1),
  42. pointInterval: 1000*60*60 // one day
  43. }],
  44. },
  45. styles: {
  46. width: "600rpx",
  47. height: "600rpx"
  48. }
  49. }
  50. },
  51. methods: {},
  52. onLoad() {
  53. },
  54. components: {
  55. highcharts
  56. }
  57. }
  58. </script>
  59. <style>
  60. </style>