山峦图演示
参考配置
基础山峰图
html
<template>
<view class="container">
<t-xcharts
ref="chart"
:option="chartOption"
></t-xcharts>
</view>
</template>
<script setup>
import { ref } from 'vue';
const chartOption = ref({
type: 'mount',
animation: true,
dataLabel: true,
xAxis: {
disableGrid: true
},
yAxis: {
data: [{
min: 0,
max: 100
}]
},
series: [{
name: '销量',
data: [15, 20, 45, 37, 43, 34, 50],
color: '#2979ff'
}],
categories: ['周一', '周二', '周三', '周四', '周五', '周六', '周日']
});
</script>配置说明
type
图表类型,设置为 'mount' 表示山峰图。
山峰图是柱状图的变体,顶部采用山峰形状,视觉效果更柔和。配置方式与柱状图类似。