123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119 |
- <template>
- <view class="chart-container">
- <view class="chart-name">
- <view class="t-icon t-icon-xtubiao-4"></view>
- <text class="chart-name-text">走势对比</text>
- </view>
-
- <view class="charts-box">
- <qiun-data-charts
- type="mini-line"
- :chartData="chartData"
- :loadingType="4"
- background="none"
- :tapLegend="false"
- :canvas2d='true' canvasId='canvans3'
- />
- </view>
- </view>
- </template>
- <script>
- export default {
- name:"line-mini-chart",
- props:{},
- data() {
- return {
- chartData: {},
- queryObj: {}
- };
- },
- methods:{
- getChartData(){
- this.chartData = {
- categories: [
- "测验1",
- "测验2",
- "测验3",
- "测验4",
- "测验5",
- ],
- series: [{
- "name": "孩子总分",
- "data": [
- 400,
- 390,
- 380,
- 399,
- 366,
- ]
- },
- {
- "name": "班级平均分",
- "data": [
- 360,
- 377,
- 355,
- 322,
- 338,
- ]
- },
- {
- "name": "年级平均分",
- "data": [
- 333,
- 346,
- 364,
- 347,
- 355,
- ]
- }
- ],
- }
-
-
- }
- },
- //创建组件生命周期函数
- created(){
- this.getChartData()
- }
- }
- </script>
- <style lang="scss">
- .chart-container {
- border-radius: 20rpx;
- display: flex;
- align-items: center;
- justify-content: center;
- flex-direction: column;
- background-color: #FFFFFF;
- box-shadow: 0 4rpx 8rpx rgba(0,0,0,0.05);
- width: 340rpx;
-
- .chart-name {
- display: flex;
- align-items: center;
- justify-content: flex-start;
- width: 100%;
- margin: 20rpx 0 20rpx 40rpx;
-
- .chart-name-text {
- margin-left: 20rpx;
- font-size: 30rpx;
- font-weight: bold;
- color: #3B4144;
- }
- }
- .charts-box{
- margin-top: 40rpx;
- width: 100%;
- height:200rpx;
- }
- }
- .t-icon{
- width: 40rpx;
- height: 40rpx;
- }
- </style>
|