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