[issues/603]图表组件数据问题
parent
5c277f9748
commit
72a0e7dbe3
|
@ -4,7 +4,7 @@
|
|||
<script lang="ts">
|
||||
import { defineComponent, PropType, ref, Ref, reactive, watchEffect } from 'vue';
|
||||
import { useECharts } from '/@/hooks/web/useECharts';
|
||||
|
||||
import { cloneDeep } from 'lodash-es';
|
||||
export default defineComponent({
|
||||
name: 'bar',
|
||||
props: {
|
||||
|
@ -61,7 +61,7 @@
|
|||
|
||||
function initCharts() {
|
||||
if (props.option) {
|
||||
Object.assign(option, props.option);
|
||||
Object.assign(option, cloneDeep(props.option));
|
||||
}
|
||||
let seriesData = props.chartData.map((item) => {
|
||||
return item.value;
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<script lang="ts">
|
||||
import { defineComponent, PropType, ref, Ref, reactive, watchEffect } from 'vue';
|
||||
import { useECharts } from '/@/hooks/web/useECharts';
|
||||
|
||||
import { cloneDeep } from 'lodash-es';
|
||||
export default defineComponent({
|
||||
name: 'barAndLine',
|
||||
props: {
|
||||
|
@ -61,7 +61,7 @@
|
|||
|
||||
function initCharts() {
|
||||
if (props.option) {
|
||||
Object.assign(option, props.option);
|
||||
Object.assign(option, cloneDeep(props.option));
|
||||
}
|
||||
//图例类型
|
||||
let typeArr = Array.from(new Set(props.chartData.map((item) => item.type)));
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<script lang="ts">
|
||||
import { defineComponent, PropType, ref, Ref, reactive, watchEffect } from 'vue';
|
||||
import { useECharts } from '/@/hooks/web/useECharts';
|
||||
|
||||
import { cloneDeep } from 'lodash-es';
|
||||
export default defineComponent({
|
||||
name: 'barMulti',
|
||||
props: {
|
||||
|
@ -67,7 +67,7 @@
|
|||
|
||||
function initCharts() {
|
||||
if (props.option) {
|
||||
Object.assign(option, props.option);
|
||||
Object.assign(option, cloneDeep(props.option));
|
||||
}
|
||||
//图例类型
|
||||
let typeArr = Array.from(new Set(props.chartData.map((item) => item.type)));
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
import { defineComponent, PropType, ref, Ref, reactive, watchEffect } from 'vue';
|
||||
import { useECharts } from '/@/hooks/web/useECharts';
|
||||
import { GaugeChart } from 'echarts/charts';
|
||||
import { cloneDeep } from 'lodash-es';
|
||||
export default defineComponent({
|
||||
name: 'Gauge',
|
||||
props: {
|
||||
|
@ -88,7 +89,7 @@
|
|||
function initCharts() {
|
||||
echarts.use(GaugeChart);
|
||||
if (props.option) {
|
||||
Object.assign(option, props.option);
|
||||
Object.assign(option, cloneDeep(props.option));
|
||||
}
|
||||
option.series[0].data[0].name = props.chartData.name;
|
||||
option.series[0].data[0].value = props.chartData.value;
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<script lang="ts">
|
||||
import { defineComponent, PropType, ref, Ref, reactive, watchEffect } from 'vue';
|
||||
import { useECharts } from '/@/hooks/web/useECharts';
|
||||
|
||||
import { cloneDeep } from 'lodash-es';
|
||||
export default defineComponent({
|
||||
name: 'line',
|
||||
props: {
|
||||
|
@ -63,7 +63,7 @@
|
|||
|
||||
function initCharts() {
|
||||
if (props.option) {
|
||||
Object.assign(option, props.option);
|
||||
Object.assign(option, cloneDeep(props.option));
|
||||
}
|
||||
let seriesData = props.chartData.map((item) => {
|
||||
return item.value;
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
<script lang="ts">
|
||||
import { defineComponent, PropType, ref, Ref, reactive, watchEffect } from 'vue';
|
||||
import { useECharts } from '/@/hooks/web/useECharts';
|
||||
import { cloneDeep } from 'lodash-es';
|
||||
|
||||
export default defineComponent({
|
||||
name: 'lineMulti',
|
||||
|
@ -67,7 +68,7 @@
|
|||
|
||||
function initCharts() {
|
||||
if (props.option) {
|
||||
Object.assign(option, props.option);
|
||||
Object.assign(option, cloneDeep(props.option));
|
||||
}
|
||||
//图例类型
|
||||
let typeArr = Array.from(new Set(props.chartData.map((item) => item.type)));
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<script lang="ts">
|
||||
import { defineComponent, PropType, ref, Ref, watchEffect, reactive, watch } from 'vue';
|
||||
import { useECharts } from '/@/hooks/web/useECharts';
|
||||
|
||||
import { cloneDeep } from 'lodash-es';
|
||||
export default defineComponent({
|
||||
name: 'Pie',
|
||||
props: {
|
||||
|
@ -70,7 +70,7 @@
|
|||
);
|
||||
function initCharts() {
|
||||
if (props.option) {
|
||||
Object.assign(option, props.option);
|
||||
Object.assign(option, cloneDeep(props.option));
|
||||
}
|
||||
option.series[0].data = props.chartData;
|
||||
setOptions(option);
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<script lang="ts">
|
||||
import { defineComponent, PropType, ref, Ref, reactive, watchEffect } from 'vue';
|
||||
import { useECharts } from '/@/hooks/web/useECharts';
|
||||
|
||||
import { cloneDeep } from 'lodash-es';
|
||||
export default defineComponent({
|
||||
name: 'Radar',
|
||||
props: {
|
||||
|
@ -64,7 +64,7 @@
|
|||
|
||||
function initCharts() {
|
||||
if (props.option) {
|
||||
Object.assign(option, props.option);
|
||||
Object.assign(option, cloneDeep(props.option));
|
||||
}
|
||||
//图例类型
|
||||
let typeArr = Array.from(new Set(props.chartData.map((item) => item.type)));
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<script lang="ts">
|
||||
import { defineComponent, PropType, ref, Ref, reactive, watchEffect, watch } from 'vue';
|
||||
import { useECharts } from '/@/hooks/web/useECharts';
|
||||
|
||||
import { cloneDeep } from 'lodash-es';
|
||||
export default defineComponent({
|
||||
name: 'StackBar',
|
||||
props: {
|
||||
|
@ -82,7 +82,7 @@
|
|||
);
|
||||
function initCharts() {
|
||||
if (props.option) {
|
||||
Object.assign(option, props.option);
|
||||
Object.assign(option, cloneDeep(props.option));
|
||||
}
|
||||
//图例类型
|
||||
let typeArr = Array.from(new Set(props.chartData.map((item) => item.type)));
|
||||
|
|
Loading…
Reference in New Issue