123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111 |
- import * as echarts from '../../ec-canvas/echarts';
- var app = getApp()
- function initChart(canvas, width, height, dpr, data) {
- const chart = echarts.init(canvas, null, {
- width: width,
- height: height,
- devicePixelRatio: dpr // new
- });
- canvas.setChart(chart);
- var option = {
- xAxis : {
- type : 'category',
- splitNumber: 2,
- scale: true,
- show:false,
- splitLine:{
- show:false
- }
- },
- yAxis : {
- type : 'value',
- splitNumber: 2,
- scale: true,
- show:false,
- splitLine:{
- show:false
- }
- },
-
- series: [{
- type: 'line',
- smooth: true,
- symbol: 'none',
- lineStyle: {
- color: '#D81E06',
- },
- data:data,
- areaStyle: {
- color: '#D81E06',
- },
- }]
- };
- chart.setOption(option);
- return chart;
- }
- Page({
- data: {
- // 页面配置
- winWidth: 0,
- winHeight: 0,
- // tab切换
- currentTab: 0,
- ec: {
- onInit: initChart
- },
- array:[
- {
- title:'BK0422',
- subtitle:"交运物流",
- Increase:"+1.22",
- digital:"33",
- color:'crimson',
- data:[52,56,355,444],
- keep:'已关注'
- },
- {
- title:'BK0738',
- subtitle:"多元金融",
- Increase:"+1.22",
- digital:"33",
- color:'crimson',
- data:[52,56,355,444],
- keep:'已关注'
- },
- {
- title:'BK0450',
- subtitle:"港口水运",
- Increase:"+1.22",
- digital:"33",
- color:'crimson',
- data:[52,56,355,444,52,56,355,444,52,56,355,444,2],
- keep:'已关注'
- }
- ],
- },
- onLoad: function() {
- var that = this;
- // 获取系统信息
- wx.getSystemInfo({
- success: function(res) {
-
- that.setData({
- winWidth: res.windowWidth,
- winHeight: res.windowHeight
- });
- }
- });
- },
- open: function (e) {
- console.log(e)
- wx.navigateTo({
- url: '../item/item?row='+JSON.stringify(e.currentTarget.dataset.row)
- });
- }
- })
|