这篇文章主要介绍了vue中使用echarts的步骤,帮助大家更好的理解和使用vue框架,感兴趣的朋友可以了解下
1:首先要用到echarts
2:在vue中安装这个依赖
3:引入要用的页面
import echarts from 'echarts';
4:然后初始化
<div class="layui-col-md6 tjgx-panel"> <div class="layui-card"> <div class="layui-card-header panel-title"> <span class="left-text">统计更新及时率</span> <div class="right-text" style="color: #b0b0b0"> <span class="week">{{item.name}}</span><!-- <span class="month">本月</span> <span class="year">本年</span> --></div></div><div class="layui-card-body common-height"> <!-- <div class="tjgx-con" id="container" style="min-height:280px"></div> --></div></div></div> /* .week{ padding: 0 1%; } */ .layui-card-header { position: relative; height: 42px; line-height: 42px; padding: 0 15px; border-bottom: 1px solid #f6f6f6; color: #333; border-radius: 2px 2px 0 0; font-size: 14px; } .common-height { height: 280px; } .layui-card { margin-bottom: 15px; border-radius: 2px; background-color: #fff; box-shadow: 0 1px 2px 0 rgba(0,0,0,.05); } .layui-card-body { position: relative; padding: 10px 15px; line-height: 24px; } .layui-col-md20 { width: 20%; } .time-city-panel { display: flex !important; justify-content: space-between; align-items: center; } .time-city-panel img { width: 73px !important; height: 61px !important; padding: 0 10px 10px !important; } .time-city-panel .one-row, .time-city-panel .two-row { padding: 0 10px; } .time-city-panel .one-row p:first-of-type { font-size: 18px; font-weight: bold; padding: 0 0 10px; text-align: left; } .time-city-panel .two-row p:first-of-type { padding: 0 0 10px; color: #96acbc; font-weight: bold; line-height: 22px; } .db_img { width: 20px; height: 22px; margin: 0 5px; vertical-align: middle; } .panel-title .left-text { padding-left: 10px; border-left: 8px solid #239fe6; font-size: 20px; display: inline-block; height: 30px; line-height: 30px; vertical-align: middle; } .panel-title .right-text { float: right; color: #239fe6; font-size: 14px; margin-left: 15px; } /*筒高度*/ .common-height { height: 280px; } .text-overflow { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .tjgx-panel .right-text span, .ajtj-panel .right-text span { display: inline-block; color: #b0b0b0; } .tjgx-panel .right-text span.acitive, .ajtj-panel .right-text span.acitive { color: #239fe6; } #chart, #ajtjChart { width: 100%; height: 90%; }
5:Echarts 组件
<div> <!-- style="min-height:280px;" --><div id="Echarts"></div><!-- <div id="Echarts"></div> --></div>
6:效果图
以上就是vue中使用echarts的步骤的详细内容,更多关于vue 使用echarts的资料请关注gaodaima搞代码网其它相本文来源gaodai#ma#com搞*!代#%^码网%关文章!
以上就是vue中使用echarts的示例的详细内容,更多请关注gaodaima搞代码网其它相关文章!