mirror of
https://gitee.com/dromara/go-view.git
synced 2026-05-30 00:00:05 +08:00
feat: 新增柱状图配置
This commit is contained in:
@@ -7,7 +7,7 @@ import axisThemeJson from '@/settings/vchartThemes/axis.theme.json'
|
||||
import { ChatCategoryEnum, IBarOption } from '../../index.d'
|
||||
import { merge, cloneDeep } from 'lodash'
|
||||
|
||||
export const includes = ['legends', 'tooltip']
|
||||
export const includes = ['legends', 'tooltip', 'label', 'bar']
|
||||
export const option: IBarOption & { dataset?: any } = {
|
||||
// 图表配置
|
||||
type: 'bar',
|
||||
|
||||
@@ -3,11 +3,15 @@
|
||||
<VChartGlobalSetting :optionData="optionData"></VChartGlobalSetting>
|
||||
<Axis :axis="optionData.xAxis"></Axis>
|
||||
<Axis :axis="optionData.yAxis"></Axis>
|
||||
<!-- 标签 -->
|
||||
<Label :optionData="optionData"></Label>
|
||||
<!-- 柱体 -->
|
||||
<Bar :optionData="optionData"></Bar>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { PropType } from 'vue'
|
||||
import { VChartGlobalSetting, Axis } from '@/components/Pages/VChartItemSetting'
|
||||
import { VChartGlobalSetting, Axis, Label, Bar } from '@/components/Pages/VChartItemSetting'
|
||||
import { vChartGlobalThemeJsonType } from '@/settings/vchartThemes/index'
|
||||
|
||||
defineProps({
|
||||
|
||||
@@ -6,8 +6,16 @@ import data from './data.json'
|
||||
import axisThemeJson from '@/settings/vchartThemes/axis.theme.json'
|
||||
import { ChatCategoryEnum, IBarOption } from '../../index.d'
|
||||
import { merge, cloneDeep } from 'lodash'
|
||||
import { vChartGlobalThemeJson } from '@/settings/vchartThemes'
|
||||
|
||||
export const includes = ['legends', 'tooltip']
|
||||
const barConfig = merge(cloneDeep(vChartGlobalThemeJson.bar), {
|
||||
style: {
|
||||
height: 10
|
||||
}
|
||||
})
|
||||
delete (barConfig.style as { width?: any }).width
|
||||
|
||||
export const includes = ['legends', 'tooltip', 'label']
|
||||
export const option: IBarOption & { dataset?: any } = {
|
||||
// 图表配置
|
||||
type: 'bar',
|
||||
@@ -50,6 +58,9 @@ export const option: IBarOption & { dataset?: any } = {
|
||||
...axisThemeJson.grid.style
|
||||
}
|
||||
}
|
||||
},
|
||||
bar: {
|
||||
...barConfig
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,11 +3,15 @@
|
||||
<VChartGlobalSetting :optionData="optionData"></VChartGlobalSetting>
|
||||
<Axis :axis="optionData.xAxis"></Axis>
|
||||
<Axis :axis="optionData.yAxis"></Axis>
|
||||
<!-- 标签 -->
|
||||
<Label :optionData="optionData"></Label>
|
||||
<!-- 柱体 -->
|
||||
<Bar :optionData="optionData"></Bar>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { PropType } from 'vue'
|
||||
import { VChartGlobalSetting, Axis } from '@/components/Pages/VChartItemSetting'
|
||||
import { VChartGlobalSetting, Axis, Label, Bar } from '@/components/Pages/VChartItemSetting'
|
||||
import { vChartGlobalThemeJsonType } from '@/settings/vchartThemes/index'
|
||||
|
||||
defineProps({
|
||||
|
||||
@@ -6,8 +6,15 @@ import data from './data.json'
|
||||
import axisThemeJson from '@/settings/vchartThemes/axis.theme.json'
|
||||
import { ChatCategoryEnum, IBarOption } from '../../index.d'
|
||||
import { merge, cloneDeep } from 'lodash'
|
||||
import { vChartGlobalThemeJson } from '@/settings/vchartThemes'
|
||||
|
||||
export const includes = ['legends', 'tooltip']
|
||||
const barConfig = merge(cloneDeep(vChartGlobalThemeJson.bar), {
|
||||
style: {
|
||||
width: 15
|
||||
}
|
||||
})
|
||||
|
||||
export const includes = ['legends', 'tooltip', 'label']
|
||||
export const option: IBarOption & { dataset?: any } = {
|
||||
// 图表配置
|
||||
type: 'bar',
|
||||
@@ -49,6 +56,9 @@ export const option: IBarOption & { dataset?: any } = {
|
||||
...axisThemeJson.grid.style
|
||||
}
|
||||
}
|
||||
},
|
||||
bar: {
|
||||
...barConfig
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,11 +3,15 @@
|
||||
<VChartGlobalSetting :optionData="optionData"></VChartGlobalSetting>
|
||||
<Axis :axis="optionData.xAxis"></Axis>
|
||||
<Axis :axis="optionData.yAxis"></Axis>
|
||||
<!-- 标签 -->
|
||||
<Label :optionData="optionData"></Label>
|
||||
<!-- 柱体 -->
|
||||
<Bar :optionData="optionData"></Bar>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { PropType } from 'vue'
|
||||
import { VChartGlobalSetting, Axis } from '@/components/Pages/VChartItemSetting'
|
||||
import { VChartGlobalSetting, Axis, Label, Bar } from '@/components/Pages/VChartItemSetting'
|
||||
import { vChartGlobalThemeJsonType } from '@/settings/vchartThemes/index'
|
||||
|
||||
defineProps({
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
<n-input v-model:value="optionData.centerY" :step="1" :min="0" size="small"></n-input>
|
||||
</setting-item>
|
||||
</SettingItemBox>
|
||||
<SettingItemBox name="标签">
|
||||
<SettingItemBox name="标签" v-if="optionData.label">
|
||||
<SettingItem>
|
||||
<n-space>
|
||||
<n-switch v-model:value="optionData.label.visible" size="small"></n-switch>
|
||||
@@ -45,11 +45,7 @@
|
||||
</SettingItemBox>
|
||||
<SettingItemBox name="分段样式">
|
||||
<setting-item name="纹理类型">
|
||||
<n-select
|
||||
v-model:value="optionData.pie.style.texture"
|
||||
:options="styleConfig.texture"
|
||||
size="small"
|
||||
></n-select>
|
||||
<n-select v-model:value="optionData.pie.style.texture" :options="styleConfig.texture" size="small"></n-select>
|
||||
</setting-item>
|
||||
<setting-item name="圆角大小">
|
||||
<n-input-number v-model:value="optionData.pie.style.cornerRadius" size="small" :min="0"></n-input-number>
|
||||
|
||||
Reference in New Issue
Block a user