Browse Source

横坐标

master
maochaoying 2 years ago
parent
commit
7a829fcac6
  1. 27
      src/components/Progress.vue
  2. 7
      src/store/modules/echarts.js

27
src/components/Progress.vue

@ -132,10 +132,7 @@ const binOption = ref({
xAxis: {
type: 'category',
boundaryGap: false,
data: Array.from(
Array(Object.keys(echartsStore.binCharts).length),
(v, k) => k,
),
data: echartsStore.abscissaFormater,
},
yAxis: {
type: 'value',
@ -183,7 +180,7 @@ const envir1Option = ref({
xAxis: {
type: 'category',
boundaryGap: false,
data: Object.keys(echartsStore.envir1Charts),
data: echartsStore.abscissaFormater,
},
yAxis: {
type: 'value',
@ -231,7 +228,7 @@ const envir2Option = ref({
xAxis: {
type: 'category',
boundaryGap: false,
data: Object.keys(echartsStore.envir2Charts),
data: echartsStore.abscissaFormater,
},
yAxis: {
type: 'value',
@ -320,10 +317,7 @@ onMounted(() => {
xAxis: {
type: 'category',
boundaryGap: false,
data: Array.from(
Array(Object.keys(echartsStore.binCharts).length),
(v, k) => k,
),
data: echartsStore.abscissaFormater,
},
yAxis: {
type: 'value',
@ -371,7 +365,7 @@ onMounted(() => {
xAxis: {
type: 'category',
boundaryGap: false,
data: Object.keys(echartsStore.envir1Charts),
data: echartsStore.abscissaFormater,
},
yAxis: {
type: 'value',
@ -419,7 +413,7 @@ onMounted(() => {
xAxis: {
type: 'category',
boundaryGap: false,
data: Object.keys(echartsStore.envir2Charts),
data: echartsStore.abscissaFormater,
},
yAxis: {
type: 'value',
@ -470,10 +464,7 @@ onMounted(() => {
xAxis: {
type: 'category',
boundaryGap: false,
data: Array.from(
Array(Object.keys(echartsStore.binCharts).length),
(v, k) => k,
),
data: echartsStore.abscissaFormater,
},
yAxis: {
type: 'value',
@ -521,7 +512,7 @@ onMounted(() => {
xAxis: {
type: 'category',
boundaryGap: false,
data: Object.keys(echartsStore.envir1Charts),
data: echartsStore.abscissaFormater,
},
yAxis: {
type: 'value',
@ -569,7 +560,7 @@ onMounted(() => {
xAxis: {
type: 'category',
boundaryGap: false,
data: Object.keys(echartsStore.envir2Charts),
data: echartsStore.abscissaFormater,
},
yAxis: {
type: 'value',

7
src/store/modules/echarts.js

@ -22,6 +22,13 @@ export const useEchartsStore = defineStore({
},
},
getters: {
abscissaFormater(state) {
let arr = []
Object.keys(state.binCharts).map((item, index) => {
arr.push(`${index}-${item}`)
})
return arr
},
binTemp(state) {
let arr = []
Object.values(state.binCharts).map(item => {

Loading…
Cancel
Save