Switch to useWebSocketStore in RealtimeEnergyChartCard

This commit is contained in:
rafaeldpsilva
2025-09-30 17:58:26 +01:00
parent 83eaa7e121
commit c360fb81cd

View File

@@ -18,7 +18,7 @@ import {
GridComponent,
} from 'echarts/components'
import { computed } from 'vue'
import { useEnergyStore } from '@/stores/energy'
import { useWebSocketStore } from '@/stores/websocket'
use([TitleComponent, TooltipComponent, LegendComponent, LineChart, CanvasRenderer, GridComponent])
@@ -26,7 +26,7 @@ defineProps<{
title: string
}>()
const energyStore = useEnergyStore()
const websocketStore = useWebSocketStore()
const option = computed(() => ({
grid: {
@@ -48,7 +48,7 @@ const option = computed(() => ({
},
xAxis: {
type: 'category',
data: energyStore.timeSeriesData.labels,
data: websocketStore.timeSeriesData.labels,
axisLabel: {
fontFamily:
'ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"',
@@ -63,16 +63,16 @@ const option = computed(() => ({
},
series: [
{
data: energyStore.timeSeriesData.datasets[0].data,
data: websocketStore.timeSeriesData.datasets[0].data,
type: 'line',
showSymbol: false,
smooth: true,
itemStyle: {
color: '#3b82f6'
color: '#3b82f6',
},
lineStyle: {
color: '#3b82f6'
}
color: '#3b82f6',
},
},
],
}))