attention.js 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. import * as echarts from '../../ec-canvas/echarts';
  2. var app = getApp()
  3. function initChart(canvas, width, height, dpr, data) {
  4. const chart = echarts.init(canvas, null, {
  5. width: width,
  6. height: height,
  7. devicePixelRatio: dpr // new
  8. });
  9. canvas.setChart(chart);
  10. var option = {
  11. xAxis : {
  12. type : 'category',
  13. splitNumber: 2,
  14. scale: true,
  15. show:false,
  16. splitLine:{
  17.     show:false
  18.   }
  19. },
  20. yAxis : {
  21. type : 'value',
  22. splitNumber: 2,
  23. scale: true,
  24. show:false,
  25. splitLine:{
  26.     show:false
  27.    }
  28. },
  29. series: [{
  30. type: 'line',
  31. smooth: true,
  32. symbol: 'none',
  33. lineStyle: {
  34. color: '#D81E06',
  35. },
  36. data:data,
  37. areaStyle: {
  38. color: '#D81E06',
  39. },
  40. }]
  41. };
  42. chart.setOption(option);
  43. return chart;
  44. }
  45. Page({
  46. data: {
  47. // 页面配置
  48. winWidth: 0,
  49. winHeight: 0,
  50. // tab切换
  51. currentTab: 0,
  52. ec: {
  53. onInit: initChart
  54. },
  55. array:[
  56. {
  57. title:'AppL',
  58. subtitle:"APPL INC",
  59. Increase:"1.22",
  60. digital:"33",
  61. data:[52,56,355,444]
  62. },
  63. {
  64. title:'AppL',
  65. subtitle:"APPL INC",
  66. Increase:"1.22",
  67. digital:"33",
  68. data:[52,56,355,444,52,56,355,444,52,56,355,444,2]
  69. },
  70. {
  71. title:'AppL',
  72. subtitle:"APPL INC",
  73. Increase:"1.22",
  74. digital:"33",
  75. data:[52,56,355,44554]
  76. },
  77. {
  78. title:'AppL',
  79. subtitle:"APPL INC",
  80. Increase:"1.22",
  81. digital:"33",
  82. data:[52,56,355,444]
  83. },
  84. {
  85. title:'AppL',
  86. subtitle:"APPL INC",
  87. Increase:"1.22",
  88. digital:"33",
  89. data:[52,56,355,444]
  90. }
  91. ],
  92. },
  93. onLoad: function() {
  94. var that = this;
  95. // 获取系统信息
  96. wx.getSystemInfo({
  97. success: function(res) {
  98. that.setData({
  99. winWidth: res.windowWidth,
  100. winHeight: res.windowHeight
  101. });
  102. }
  103. });
  104. },
  105. open: function (e) {
  106. console.log(e)
  107. wx.navigateTo({
  108. url: '../item/item'
  109. });
  110. }
  111. })