mirror of
https://gitee.com/dromara/go-view.git
synced 2025-08-06 22:11:16 +08:00
feat: 堆叠图支持开启百分比模式
This commit is contained in:
parent
99366efc8c
commit
a9bb5e5397
@ -23,6 +23,8 @@ export const option: IBarOption & { dataset?: any } = {
|
||||
yField: ['value'],
|
||||
seriesField: 'year',
|
||||
stack: true,
|
||||
// 开启百分比
|
||||
percent: false,
|
||||
// 业务配置(后续会被转换为图表spec)
|
||||
category: VChartBarStackConfig.category as ChatCategoryEnum.BAR,
|
||||
xAxis: {
|
||||
|
@ -7,12 +7,22 @@
|
||||
<Label :optionData="optionData"></Label>
|
||||
<!-- 柱体 -->
|
||||
<Bar :optionData="optionData"></Bar>
|
||||
<!-- 开启百分比 -->
|
||||
<CollapseItem name="百分比堆叠">
|
||||
<SettingItemBox name="配置" alone>
|
||||
<n-space>
|
||||
<span>开启百分比堆叠</span>
|
||||
<n-switch v-model:value="optionData.percent" size="small"></n-switch>
|
||||
</n-space>
|
||||
</SettingItemBox>
|
||||
</CollapseItem>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { PropType } from 'vue'
|
||||
import { VChartGlobalSetting, Axis, Label, Bar } from '@/components/Pages/VChartItemSetting'
|
||||
import { vChartGlobalThemeJsonType } from '@/settings/vchartThemes/index'
|
||||
import { CollapseItem, SettingItemBox, SettingItem } from '@/components/Pages/ChartItemSetting'
|
||||
|
||||
defineProps({
|
||||
optionData: {
|
||||
|
Loading…
x
Reference in New Issue
Block a user