attention.js 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  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:'BK0422',
  58. subtitle:"交运物流",
  59. Increase:"+1.22",
  60. digital:"33",
  61. color:'crimson',
  62. data:[52,56,355,444],
  63. keep:'已关注'
  64. },
  65. {
  66. title:'BK0738',
  67. subtitle:"多元金融",
  68. Increase:"+1.22",
  69. digital:"33",
  70. color:'crimson',
  71. data:[52,56,355,444],
  72. keep:'已关注'
  73. },
  74. {
  75. title:'BK0450',
  76. subtitle:"港口水运",
  77. Increase:"+1.22",
  78. digital:"33",
  79. color:'crimson',
  80. data:[52,56,355,444,52,56,355,444,52,56,355,444,2],
  81. keep:'已关注'
  82. }
  83. ],
  84. },
  85. onLoad: function() {
  86. var that = this;
  87. // 获取系统信息
  88. wx.getSystemInfo({
  89. success: function(res) {
  90. that.setData({
  91. winWidth: res.windowWidth,
  92. winHeight: res.windowHeight
  93. });
  94. }
  95. });
  96. },
  97. open: function (e) {
  98. console.log(e)
  99. wx.navigateTo({
  100. url: '../item/item?row='+JSON.stringify(e.currentTarget.dataset.row)
  101. });
  102. }
  103. })