<template>
<div class="chart-out-wrapper">
<div class="chart-wrapper"
ref="swiper"
@mouseover="mouseHover"
@mouseout="mouseOut"
>
<barChart v-for="(item, index) in categoryDataList"
:key="index"
class="chart-size"
:chartData="item"
:chartLeft="20"
:color="linearColor[index]"
ref="barchart"
>
</barChart>
<barChart class="chart-size"
:chartData="categoryDataList[0]"
:chartLeft="20"
:color="linearColor[0]"
ref="barchart"
>
</barChart>
</div>
</div>
</template>
<script>
import barChart from './barChart'
export default {
name: 'chart',
components: {
barChart
},
props: {
categoryDataList: {
type: Array,
default: function () {
return []
}
}
},
data() {
const self = this
return {
activeChartIndex: 0,
linearColor: [
new this.$echarts.graphic.LinearGradient(0, 0, 1, 1, [{
offset: 0,
color: '#394FFD' // 0% 处的颜色
}, {
offset: 1,
color: '#0AFFC5' // 100% 处的颜色
}], f
vue项目中实现无缝轮播并动态更新数据
最新推荐文章于 2025-02-19 08:00:00 发布