今天剛學(xué)使用Echart圖表,把步驟寫下來,
1.首先去git上拉一個(gè)文件
網(wǎng)址:?https://github.com/ecomfe/echarts-for-weixin

下載后打開


使用時(shí),把 ec-canvas 文件復(fù)制到項(xiàng)目中

再把需要的對(duì)應(yīng)的圖表給引進(jìn)來,就能使用了,但運(yùn)行起來,頁(yè)面會(huì)是空白的,百度了一下,是wxss的文件少了一些樣式。把下面這些復(fù)制上去。
/**index.wxss**/
ec-canvas {
? width: 100%;
? height: 100%;
}
ec-canvas {
? width: 100%;
? height: 100%;
}
.container {
? position: absolute;
? top: 0;
? bottom: 0;
? left: 0;
? right: 0;
? display: flex;
? flex-direction: column;
? align-items: center;
? justify-content: space-between;
? box-sizing: border-box;
}
.picker-pos {
? margin-top: -130rpx;
? margin-left: 150rpx;
? color: blueviolet;
}
再次運(yùn)行,就會(huì)發(fā)現(xiàn)圖表就會(huì)出現(xiàn)啦。