mirror of
https://gitee.com/dromara/go-view.git
synced 2025-02-24 00:02:51 +08:00
feat: 环形饼图增加轨道宽度设置,并优化数字显示
This commit is contained in:
parent
c70d54c622
commit
1ef6d9797a
@ -7,6 +7,22 @@
|
||||
</n-input-number>
|
||||
</SettingItem>
|
||||
</SettingItemBox>
|
||||
<!-- 中心标题 -->
|
||||
<SettingItemBox v-if="config.title" name="标题">
|
||||
<SettingItem name="颜色">
|
||||
<n-color-picker size="small" :modes="['hex']" v-model:value="config.title.textStyle.color"></n-color-picker>
|
||||
</SettingItem>
|
||||
<SettingItem name="字体大小">
|
||||
<n-input-number
|
||||
v-model:value="config.title.textStyle.fontSize"
|
||||
:min="0"
|
||||
:step="1"
|
||||
size="small"
|
||||
placeholder="字体大小"
|
||||
>
|
||||
</n-input-number>
|
||||
</SettingItem>
|
||||
</SettingItemBox>
|
||||
<!-- Echarts 全局设置 -->
|
||||
<SettingItemBox name="进度条">
|
||||
<SettingItem name="颜色">
|
||||
@ -31,24 +47,8 @@
|
||||
></n-color-picker>
|
||||
</SettingItem>
|
||||
</SettingItemBox>
|
||||
<!-- 中心标题 -->
|
||||
<SettingItemBox v-if="config.title" name="标题">
|
||||
<SettingItem name="颜色">
|
||||
<n-color-picker size="small" :modes="['hex']" v-model:value="config.title.textStyle.color"></n-color-picker>
|
||||
</SettingItem>
|
||||
<SettingItem name="字体大小">
|
||||
<n-input-number
|
||||
v-model:value="config.title.textStyle.fontSize"
|
||||
:min="0"
|
||||
:step="1"
|
||||
size="small"
|
||||
placeholder="字体大小"
|
||||
>
|
||||
</n-input-number>
|
||||
</SettingItem>
|
||||
</SettingItemBox>
|
||||
<!-- 其他样式 -->
|
||||
<SettingItemBox name="轨道样式">
|
||||
<SettingItemBox name="轨道">
|
||||
<SettingItem name="颜色">
|
||||
<n-color-picker size="small" :modes="['hex']" v-model:value="item.data[1].itemStyle.color"></n-color-picker>
|
||||
</SettingItem>
|
||||
@ -69,6 +69,17 @@
|
||||
v-model:value="item.data[1].itemStyle.shadowColor"
|
||||
></n-color-picker>
|
||||
</SettingItem>
|
||||
<SettingItem name="轨道宽度">
|
||||
<n-select
|
||||
v-model:value="item.radius[0]"
|
||||
:options="[
|
||||
{ label: '窄', value: '75%' },
|
||||
{ label: '中', value: '60%' },
|
||||
{ label: '宽', value: '45%' },
|
||||
{ label: '更宽', value: '30%' }
|
||||
]"
|
||||
/>
|
||||
</SettingItem>
|
||||
</SettingItemBox>
|
||||
</CollapseItem>
|
||||
</template>
|
||||
|
@ -41,7 +41,7 @@ const option = reactive({
|
||||
const dataHandle = (newData: any) => {
|
||||
const d = parseFloat(`${newData}`) * 100
|
||||
let config = props.chartConfig.option
|
||||
config.title.text = d.toFixed(2) + '%'
|
||||
config.title.text = `${+d.toFixed(2)}%`
|
||||
config.series[0].data[0].value[0] = d
|
||||
config.series[0].data[1].value[0] = 100 - d
|
||||
option.value = mergeTheme(props.chartConfig.option, props.themeSetting, includes)
|
||||
@ -68,7 +68,7 @@ watch(
|
||||
useChartDataFetch(props.chartConfig, useChartEditStore, (resData: number) => {
|
||||
let d = parseFloat(`${resData}`) * 100
|
||||
// @ts-ignore
|
||||
option.value.title.text = d.toFixed(2) + '%'
|
||||
option.value.title.text = `${+d.toFixed(2)}%`
|
||||
// @ts-ignore
|
||||
option.value.series[0].data[0].value[0] = d
|
||||
// @ts-ignore
|
||||
|
Loading…
Reference in New Issue
Block a user