mirror of
https://gitee.com/dromara/go-view.git
synced 2025-02-24 08:12:49 +08:00
fix: 修改线条的 dataset 问题
This commit is contained in:
parent
bdf7527824
commit
3d72d58e87
@ -2,6 +2,7 @@ import { echartOptionProfixHandle, publicConfig } from '@/packages/public'
|
|||||||
import { BarCrossrangeConfig } from './index'
|
import { BarCrossrangeConfig } from './index'
|
||||||
import { CreateComponentType } from '@/packages/index.d'
|
import { CreateComponentType } from '@/packages/index.d'
|
||||||
import cloneDeep from 'lodash/cloneDeep'
|
import cloneDeep from 'lodash/cloneDeep'
|
||||||
|
import dataJson from './data.json'
|
||||||
|
|
||||||
export const includes = ['legend', 'xAxis', 'yAxis']
|
export const includes = ['legend', 'xAxis', 'yAxis']
|
||||||
|
|
||||||
@ -26,33 +27,30 @@ export const option = {
|
|||||||
show: true,
|
show: true,
|
||||||
type: 'category',
|
type: 'category',
|
||||||
},
|
},
|
||||||
|
dataset: { ...dataJson },
|
||||||
series: [
|
series: [
|
||||||
{
|
{
|
||||||
name: 'data1',
|
|
||||||
type: 'bar',
|
type: 'bar',
|
||||||
barWidth: null,
|
barWidth: null,
|
||||||
itemStyle: {
|
itemStyle: {
|
||||||
color: null,
|
color: null,
|
||||||
borderRadius: 0,
|
borderRadius: 0,
|
||||||
},
|
},
|
||||||
data: [120, 200, 150, 80, 70, 110, 130],
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'data2',
|
|
||||||
type: 'bar',
|
type: 'bar',
|
||||||
barWidth: null,
|
barWidth: null,
|
||||||
itemStyle: {
|
itemStyle: {
|
||||||
color: null,
|
color: null,
|
||||||
borderRadius: 0,
|
borderRadius: 0,
|
||||||
},
|
},
|
||||||
data: [130, 130, 312, 268, 155, 117, 160],
|
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
|
||||||
export default class Config extends publicConfig
|
export default class Config extends publicConfig
|
||||||
implements CreateComponentType {
|
implements CreateComponentType {
|
||||||
public key: string = BarCrossrangeConfig.key
|
public key = BarCrossrangeConfig.key
|
||||||
public chartConfig = cloneDeep(BarCrossrangeConfig)
|
public chartConfig = cloneDeep(BarCrossrangeConfig)
|
||||||
// 图表配置项
|
// 图表配置项
|
||||||
public option = echartOptionProfixHandle(option, includes)
|
public option = echartOptionProfixHandle(option, includes)
|
||||||
|
40
src/packages/components/Charts/Bars/BarCrossrange/data.json
Normal file
40
src/packages/components/Charts/Bars/BarCrossrange/data.json
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
{
|
||||||
|
"dimensions": ["product", "data1", "data2"],
|
||||||
|
"source": [
|
||||||
|
{
|
||||||
|
"product": "Mon",
|
||||||
|
"data1": 120,
|
||||||
|
"data2": 130
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"product": "Tue",
|
||||||
|
"data1": 200,
|
||||||
|
"data2": 130
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"product": "Wed",
|
||||||
|
"data1": 150,
|
||||||
|
"data2": 312
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"product": "Thu",
|
||||||
|
"data1": 80,
|
||||||
|
"data2": 268
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"product": "Fri",
|
||||||
|
"data1": 70,
|
||||||
|
"data2": 155
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"product": "Sat",
|
||||||
|
"data1": 110,
|
||||||
|
"data2": 117
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"product": "Sun",
|
||||||
|
"data1": 130,
|
||||||
|
"data2": 160
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
@ -5,12 +5,13 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { computed, PropType } from 'vue'
|
import { computed, PropType } from 'vue'
|
||||||
import VChart from 'vue-echarts'
|
import VChart from 'vue-echarts'
|
||||||
import { use, graphic } from 'echarts/core'
|
import { use } from 'echarts/core'
|
||||||
import { CanvasRenderer } from 'echarts/renderers'
|
import { CanvasRenderer } from 'echarts/renderers'
|
||||||
import { BarChart } from 'echarts/charts'
|
import { BarChart } from 'echarts/charts'
|
||||||
import { mergeTheme } from '@/packages/public/chart'
|
import { mergeTheme } from '@/packages/public/chart'
|
||||||
import config, { includes } from './config'
|
import config, { includes } from './config'
|
||||||
import {
|
import {
|
||||||
|
DatasetComponent,
|
||||||
GridComponent,
|
GridComponent,
|
||||||
TooltipComponent,
|
TooltipComponent,
|
||||||
LegendComponent,
|
LegendComponent,
|
||||||
@ -32,6 +33,7 @@ const props = defineProps({
|
|||||||
})
|
})
|
||||||
|
|
||||||
use([
|
use([
|
||||||
|
DatasetComponent,
|
||||||
CanvasRenderer,
|
CanvasRenderer,
|
||||||
BarChart,
|
BarChart,
|
||||||
GridComponent,
|
GridComponent,
|
||||||
@ -43,5 +45,3 @@ const option = computed(() => {
|
|||||||
return mergeTheme(props.chartConfig.option, props.themeSetting, includes)
|
return mergeTheme(props.chartConfig.option, props.themeSetting, includes)
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped></style>
|
|
||||||
|
@ -2,6 +2,7 @@ import { echartOptionProfixHandle, publicConfig } from '@/packages/public'
|
|||||||
import { LineCommonConfig } from './index'
|
import { LineCommonConfig } from './index'
|
||||||
import { CreateComponentType } from '@/packages/index.d'
|
import { CreateComponentType } from '@/packages/index.d'
|
||||||
import { defaultTheme, chartColorsSearch } from '@/settings/chartThemes/index'
|
import { defaultTheme, chartColorsSearch } from '@/settings/chartThemes/index'
|
||||||
|
import dataJson from './data.json'
|
||||||
|
|
||||||
export const includes = ['legend', 'xAxis', 'yAxis']
|
export const includes = ['legend', 'xAxis', 'yAxis']
|
||||||
|
|
||||||
@ -19,15 +20,14 @@ export const option = {
|
|||||||
xAxis: {
|
xAxis: {
|
||||||
show: true,
|
show: true,
|
||||||
type: 'category',
|
type: 'category',
|
||||||
data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
|
|
||||||
},
|
},
|
||||||
yAxis: {
|
yAxis: {
|
||||||
show: true,
|
show: true,
|
||||||
type: 'value'
|
type: 'value'
|
||||||
},
|
},
|
||||||
|
dataset: { ...dataJson },
|
||||||
series: [
|
series: [
|
||||||
{
|
{
|
||||||
name: 'data1',
|
|
||||||
type: 'line',
|
type: 'line',
|
||||||
lineStyle: {
|
lineStyle: {
|
||||||
type: 'solid',
|
type: 'solid',
|
||||||
@ -50,7 +50,6 @@ export const option = {
|
|||||||
shadowBlur: 10,
|
shadowBlur: 10,
|
||||||
shadowOffsetY: 20
|
shadowOffsetY: 20
|
||||||
},
|
},
|
||||||
data: [120, 200, 150, 80, 70, 110, 130]
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
33
src/packages/components/Charts/Lines/LineCommon/data.json
Normal file
33
src/packages/components/Charts/Lines/LineCommon/data.json
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
{
|
||||||
|
"dimensions": ["product", "data1"],
|
||||||
|
"source": [
|
||||||
|
{
|
||||||
|
"product": "Mon",
|
||||||
|
"data1": 120
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"product": "Tue",
|
||||||
|
"data1": 200
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"product": "Wed",
|
||||||
|
"data1": 150
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"product": "Thu",
|
||||||
|
"data1": 80
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"product": "Fri",
|
||||||
|
"data1": 70
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"product": "Sat",
|
||||||
|
"data1": 110
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"product": "Sun",
|
||||||
|
"data1": 130
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
@ -10,9 +10,9 @@ import { CanvasRenderer } from 'echarts/renderers'
|
|||||||
import { LineChart } from 'echarts/charts'
|
import { LineChart } from 'echarts/charts'
|
||||||
import config, { includes } from './config'
|
import config, { includes } from './config'
|
||||||
import { mergeTheme } from '@/packages/public/chart'
|
import { mergeTheme } from '@/packages/public/chart'
|
||||||
import { GridComponent, TooltipComponent, LegendComponent } from 'echarts/components'
|
|
||||||
import { useChartEditStore } from '@/store/modules/chartEditStore/chartEditStore'
|
import { useChartEditStore } from '@/store/modules/chartEditStore/chartEditStore'
|
||||||
import { chartColorsSearch, defaultTheme } from '@/settings/chartThemes/index'
|
import { chartColorsSearch, defaultTheme } from '@/settings/chartThemes/index'
|
||||||
|
import { DatasetComponent, GridComponent, TooltipComponent, LegendComponent } from 'echarts/components'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
themeSetting: {
|
themeSetting: {
|
||||||
@ -30,6 +30,7 @@ const props = defineProps({
|
|||||||
})
|
})
|
||||||
|
|
||||||
use([
|
use([
|
||||||
|
DatasetComponent,
|
||||||
CanvasRenderer,
|
CanvasRenderer,
|
||||||
LineChart,
|
LineChart,
|
||||||
GridComponent,
|
GridComponent,
|
||||||
@ -52,10 +53,15 @@ watch(() => chartEditStore.getEditCanvasConfig.chartThemeColor, (newColor: keyof
|
|||||||
v.color = themeColor[i]
|
v.color = themeColor[i]
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
|
||||||
option.options = mergeTheme(props.chartConfig.option, props.themeSetting, includes)
|
option.options = mergeTheme(props.chartConfig.option, props.themeSetting, includes)
|
||||||
},
|
}
|
||||||
{
|
}, {
|
||||||
immediate: true
|
immediate: true,
|
||||||
|
})
|
||||||
|
|
||||||
|
watch(() => props.chartConfig.option.dataset, () => {
|
||||||
|
option.options = props.chartConfig.option
|
||||||
|
}, {
|
||||||
|
deep: true
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
@ -3,6 +3,7 @@ import { LineGradientSingleConfig } from './index'
|
|||||||
import { CreateComponentType } from '@/packages/index.d'
|
import { CreateComponentType } from '@/packages/index.d'
|
||||||
import { graphic } from 'echarts/core'
|
import { graphic } from 'echarts/core'
|
||||||
import { defaultTheme, chartColorsSearch } from '@/settings/chartThemes/index'
|
import { defaultTheme, chartColorsSearch } from '@/settings/chartThemes/index'
|
||||||
|
import dataJson from './data.json'
|
||||||
|
|
||||||
export const includes = ['legend', 'xAxis', 'yAxis']
|
export const includes = ['legend', 'xAxis', 'yAxis']
|
||||||
|
|
||||||
@ -20,15 +21,14 @@ const options = {
|
|||||||
xAxis: {
|
xAxis: {
|
||||||
show: true,
|
show: true,
|
||||||
type: 'category',
|
type: 'category',
|
||||||
data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
|
|
||||||
},
|
},
|
||||||
yAxis: {
|
yAxis: {
|
||||||
show: true,
|
show: true,
|
||||||
type: 'value'
|
type: 'value'
|
||||||
},
|
},
|
||||||
|
dataset: { ...dataJson },
|
||||||
series: [
|
series: [
|
||||||
{
|
{
|
||||||
name: 'data1',
|
|
||||||
type: 'line',
|
type: 'line',
|
||||||
smooth: false,
|
smooth: false,
|
||||||
lineStyle: {
|
lineStyle: {
|
||||||
@ -49,7 +49,6 @@ const options = {
|
|||||||
}
|
}
|
||||||
])
|
])
|
||||||
},
|
},
|
||||||
data: [120, 200, 150, 80, 70, 110, 130]
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,33 @@
|
|||||||
|
{
|
||||||
|
"dimensions": ["product", "data1"],
|
||||||
|
"source": [
|
||||||
|
{
|
||||||
|
"product": "Mon",
|
||||||
|
"data1": 120
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"product": "Tue",
|
||||||
|
"data1": 200
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"product": "Wed",
|
||||||
|
"data1": 150
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"product": "Thu",
|
||||||
|
"data1": 80
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"product": "Fri",
|
||||||
|
"data1": 70
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"product": "Sat",
|
||||||
|
"data1": 110
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"product": "Sun",
|
||||||
|
"data1": 130
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
@ -10,9 +10,9 @@ import { CanvasRenderer } from 'echarts/renderers'
|
|||||||
import { LineChart } from 'echarts/charts'
|
import { LineChart } from 'echarts/charts'
|
||||||
import config, { includes } from './config'
|
import config, { includes } from './config'
|
||||||
import { mergeTheme } from '@/packages/public/chart'
|
import { mergeTheme } from '@/packages/public/chart'
|
||||||
import { GridComponent, TooltipComponent, LegendComponent } from 'echarts/components'
|
|
||||||
import { useChartEditStore } from '@/store/modules/chartEditStore/chartEditStore'
|
import { useChartEditStore } from '@/store/modules/chartEditStore/chartEditStore'
|
||||||
import { chartColorsSearch, defaultTheme } from '@/settings/chartThemes/index'
|
import { chartColorsSearch, defaultTheme } from '@/settings/chartThemes/index'
|
||||||
|
import { DatasetComponent, GridComponent, TooltipComponent, LegendComponent } from 'echarts/components'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
themeSetting: {
|
themeSetting: {
|
||||||
@ -30,6 +30,7 @@ const props = defineProps({
|
|||||||
})
|
})
|
||||||
|
|
||||||
use([
|
use([
|
||||||
|
DatasetComponent,
|
||||||
CanvasRenderer,
|
CanvasRenderer,
|
||||||
LineChart,
|
LineChart,
|
||||||
GridComponent,
|
GridComponent,
|
||||||
@ -61,8 +62,13 @@ watch(()=>chartEditStore.getEditCanvasConfig.chartThemeColor, (newColor: keyof t
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
option.options = mergeTheme(props.chartConfig.option, props.themeSetting, includes)
|
option.options = mergeTheme(props.chartConfig.option, props.themeSetting, includes)
|
||||||
},
|
}, {
|
||||||
{
|
|
||||||
immediate: true
|
immediate: true
|
||||||
})
|
})
|
||||||
|
|
||||||
|
watch(() => props.chartConfig.option.dataset, () => {
|
||||||
|
option.options = props.chartConfig.option
|
||||||
|
}, {
|
||||||
|
deep: true
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
|
@ -3,6 +3,7 @@ import { LineGradientsConfig } from './index'
|
|||||||
import { CreateComponentType } from '@/packages/index.d'
|
import { CreateComponentType } from '@/packages/index.d'
|
||||||
import { graphic } from 'echarts/core'
|
import { graphic } from 'echarts/core'
|
||||||
import { defaultTheme, chartColorsSearch } from '@/settings/chartThemes/index'
|
import { defaultTheme, chartColorsSearch } from '@/settings/chartThemes/index'
|
||||||
|
import dataJson from './data.json'
|
||||||
|
|
||||||
export const includes = ['legend', 'xAxis', 'yAxis']
|
export const includes = ['legend', 'xAxis', 'yAxis']
|
||||||
|
|
||||||
@ -26,9 +27,9 @@ const option = {
|
|||||||
show: true,
|
show: true,
|
||||||
type: 'value'
|
type: 'value'
|
||||||
},
|
},
|
||||||
|
dataset: { ...dataJson },
|
||||||
series: [
|
series: [
|
||||||
{
|
{
|
||||||
name: 'data1',
|
|
||||||
type: 'line',
|
type: 'line',
|
||||||
smooth: false,
|
smooth: false,
|
||||||
lineStyle: {
|
lineStyle: {
|
||||||
@ -49,10 +50,8 @@ const option = {
|
|||||||
}
|
}
|
||||||
])
|
])
|
||||||
},
|
},
|
||||||
data: [120, 200, 150, 80, 70, 110, 130]
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'data2',
|
|
||||||
type: 'line',
|
type: 'line',
|
||||||
smooth: false,
|
smooth: false,
|
||||||
lineStyle: {
|
lineStyle: {
|
||||||
@ -73,7 +72,6 @@ const option = {
|
|||||||
}
|
}
|
||||||
])
|
])
|
||||||
},
|
},
|
||||||
data: [130, 130, 312, 268, 155, 117, 160]
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
40
src/packages/components/Charts/Lines/LineGradients/data.json
Normal file
40
src/packages/components/Charts/Lines/LineGradients/data.json
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
{
|
||||||
|
"dimensions": ["product", "data1", "data2"],
|
||||||
|
"source": [
|
||||||
|
{
|
||||||
|
"product": "Mon",
|
||||||
|
"data1": 120,
|
||||||
|
"data2": 130
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"product": "Tue",
|
||||||
|
"data1": 200,
|
||||||
|
"data2": 130
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"product": "Wed",
|
||||||
|
"data1": 150,
|
||||||
|
"data2": 312
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"product": "Thu",
|
||||||
|
"data1": 80,
|
||||||
|
"data2": 268
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"product": "Fri",
|
||||||
|
"data1": 70,
|
||||||
|
"data2": 155
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"product": "Sat",
|
||||||
|
"data1": 110,
|
||||||
|
"data2": 117
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"product": "Sun",
|
||||||
|
"data1": 130,
|
||||||
|
"data2": 160
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
@ -10,9 +10,9 @@ import { CanvasRenderer } from 'echarts/renderers'
|
|||||||
import { LineChart } from 'echarts/charts'
|
import { LineChart } from 'echarts/charts'
|
||||||
import config, { includes } from './config'
|
import config, { includes } from './config'
|
||||||
import { mergeTheme } from '@/packages/public/chart'
|
import { mergeTheme } from '@/packages/public/chart'
|
||||||
import { GridComponent, TooltipComponent, LegendComponent } from 'echarts/components'
|
|
||||||
import { useChartEditStore } from '@/store/modules/chartEditStore/chartEditStore'
|
import { useChartEditStore } from '@/store/modules/chartEditStore/chartEditStore'
|
||||||
import { chartColorsSearch, defaultTheme } from '@/settings/chartThemes/index'
|
import { chartColorsSearch, defaultTheme } from '@/settings/chartThemes/index'
|
||||||
|
import { DatasetComponent, GridComponent, TooltipComponent, LegendComponent } from 'echarts/components'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
themeSetting: {
|
themeSetting: {
|
||||||
@ -30,6 +30,7 @@ const props = defineProps({
|
|||||||
})
|
})
|
||||||
|
|
||||||
use([
|
use([
|
||||||
|
DatasetComponent,
|
||||||
CanvasRenderer,
|
CanvasRenderer,
|
||||||
LineChart,
|
LineChart,
|
||||||
GridComponent,
|
GridComponent,
|
||||||
@ -60,8 +61,13 @@ watch(()=>chartEditStore.getEditCanvasConfig.chartThemeColor, (newColor: keyof t
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
option.options = mergeTheme(props.chartConfig.option, props.themeSetting, includes)
|
option.options = mergeTheme(props.chartConfig.option, props.themeSetting, includes)
|
||||||
},
|
}, {
|
||||||
{
|
|
||||||
immediate: true
|
immediate: true
|
||||||
})
|
})
|
||||||
|
|
||||||
|
watch(() => props.chartConfig.option.dataset, () => {
|
||||||
|
option.options = props.chartConfig.option
|
||||||
|
}, {
|
||||||
|
deep: true
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
import { echartOptionProfixHandle, publicConfig } from '@/packages/public'
|
import { echartOptionProfixHandle, publicConfig } from '@/packages/public'
|
||||||
import { PieCommonConfig } from './index'
|
import { PieCommonConfig } from './index'
|
||||||
import { CreateComponentType } from '@/packages/index.d'
|
import { CreateComponentType } from '@/packages/index.d'
|
||||||
|
import dataJson from './data.json'
|
||||||
|
|
||||||
export const includes = ['legend']
|
export const includes = ['legend']
|
||||||
|
|
||||||
@ -12,9 +13,9 @@ const option = {
|
|||||||
legend: {
|
legend: {
|
||||||
show: true,
|
show: true,
|
||||||
},
|
},
|
||||||
|
dataset: { ...dataJson },
|
||||||
series: [
|
series: [
|
||||||
{
|
{
|
||||||
name: 'Access From',
|
|
||||||
type: 'pie',
|
type: 'pie',
|
||||||
radius: ['40%', '65%'],
|
radius: ['40%', '65%'],
|
||||||
center: ['50%', '60%'],
|
center: ['50%', '60%'],
|
||||||
@ -38,14 +39,7 @@ const option = {
|
|||||||
},
|
},
|
||||||
labelLine: {
|
labelLine: {
|
||||||
show: false
|
show: false
|
||||||
},
|
}
|
||||||
data: [
|
|
||||||
{ value: 1048, name: 'Search Engine' },
|
|
||||||
{ value: 735, name: 'Direct' },
|
|
||||||
{ value: 580, name: 'Email' },
|
|
||||||
{ value: 484, name: 'Union Ads' },
|
|
||||||
{ value: 300, name: 'Video Ads' }
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
33
src/packages/components/Charts/Pies/PieCommon/data.json
Normal file
33
src/packages/components/Charts/Pies/PieCommon/data.json
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
{
|
||||||
|
"dimensions": ["product", "data1"],
|
||||||
|
"source": [
|
||||||
|
{
|
||||||
|
"product": "Mon",
|
||||||
|
"data1": 120
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"product": "Tue",
|
||||||
|
"data1": 200
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"product": "Wed",
|
||||||
|
"data1": 150
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"product": "Thu",
|
||||||
|
"data1": 80
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"product": "Fri",
|
||||||
|
"data1": 70
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"product": "Sat",
|
||||||
|
"data1": 110
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"product": "Sun",
|
||||||
|
"data1": 130
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
@ -5,12 +5,13 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { computed, PropType } from 'vue'
|
import { computed, PropType } from 'vue'
|
||||||
import VChart from 'vue-echarts'
|
import VChart from 'vue-echarts'
|
||||||
import { use, graphic } from 'echarts/core'
|
import { use } from 'echarts/core'
|
||||||
import { CanvasRenderer } from 'echarts/renderers'
|
import { CanvasRenderer } from 'echarts/renderers'
|
||||||
import { PieChart } from 'echarts/charts'
|
import { PieChart } from 'echarts/charts'
|
||||||
import { mergeTheme } from '@/packages/public/chart'
|
import { mergeTheme } from '@/packages/public/chart'
|
||||||
import config, { includes } from './config'
|
import config, { includes } from './config'
|
||||||
import {
|
import {
|
||||||
|
DatasetComponent,
|
||||||
GridComponent,
|
GridComponent,
|
||||||
TooltipComponent,
|
TooltipComponent,
|
||||||
LegendComponent,
|
LegendComponent,
|
||||||
@ -32,6 +33,7 @@ const props = defineProps({
|
|||||||
})
|
})
|
||||||
|
|
||||||
use([
|
use([
|
||||||
|
DatasetComponent,
|
||||||
CanvasRenderer,
|
CanvasRenderer,
|
||||||
PieChart,
|
PieChart,
|
||||||
GridComponent,
|
GridComponent,
|
||||||
|
@ -36,7 +36,7 @@
|
|||||||
</n-timeline-item>
|
</n-timeline-item>
|
||||||
<n-timeline-item type="success" :title="TimelineTitleEnum.CONTENT">
|
<n-timeline-item type="success" :title="TimelineTitleEnum.CONTENT">
|
||||||
<n-space vertical>
|
<n-space vertical>
|
||||||
<n-text prefix="bar" depth="3">数据格式需要符合 ECharts-setdata 规范</n-text>
|
<n-text depth="3">数据需要符合 ECharts-setdata 规范</n-text>
|
||||||
<n-space class="source-btn-box">
|
<n-space class="source-btn-box">
|
||||||
<n-upload
|
<n-upload
|
||||||
v-model:file-list="uploadFileListRef"
|
v-model:file-list="uploadFileListRef"
|
||||||
|
Loading…
Reference in New Issue
Block a user