Skip to content

Commit

Permalink
web: fix hourly chart after change solar pv serie name
Browse files Browse the repository at this point in the history
  • Loading branch information
hoang-rio committed Nov 28, 2024
1 parent 69721bc commit 23ab0fe
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 16 deletions.
18 changes: 11 additions & 7 deletions web_viewer/fe_src/src/components/HourlyChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import "./HourlyChart.css";
import Chart from "react-apexcharts";
import { IClassNameProps, IUpdateChart, SeriesItem } from "../Intefaces";

const SOLAR_PV_SERIE_NAME = "Solar PV";
const BATTERY_SERIE_NAME = "Battery";
const GRID_SERIE_NAME = "Grid";

Expand Down Expand Up @@ -40,7 +41,7 @@ const HourlyChart = forwardRef(
});
return [
{
name: "Solar PV",
name: SOLAR_PV_SERIE_NAME,
data: pvSeries,
},
{
Expand Down Expand Up @@ -180,14 +181,17 @@ const HourlyChart = forwardRef(
min: startOfDay.getTime(),
labels: {
datetimeUTC: false,
format: "HH:mm"
format: "HH:mm",
},
},
yaxis: [
{ seriesName: "PV", title: { text: "Power (W)" } },
{ seriesName: "PV", show: false },
{ seriesName: "PV", show: false },
{ seriesName: "PV", show: false },
{
seriesName: SOLAR_PV_SERIE_NAME,
title: { text: "Power (W)" },
},
{ seriesName: SOLAR_PV_SERIE_NAME, show: false },
{ seriesName: SOLAR_PV_SERIE_NAME, show: false },
{ seriesName: SOLAR_PV_SERIE_NAME, show: false },
{
seriesName: "SOC",
opposite: true,
Expand Down Expand Up @@ -221,7 +225,7 @@ const HourlyChart = forwardRef(
return `${seriesName} discharge:`;
}
if (seriesName === GRID_SERIE_NAME) {
return 'Import Grid Power:'
return "Import Grid Power:";
}
return `${seriesName}:`;
},
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1 +1 @@
import{j as e}from"./index-DTzOqlDt.js";function l({value:r,unit:s,className:n}){return e.jsxs("div",{className:`${n||""} general-value`,children:[e.jsx("strong",{children:r}),s]})}export{l as G};
import{j as e}from"./index--yuavyFR.js";function l({value:r,unit:s,className:n}){return e.jsxs("div",{className:`${n||""} general-value`,children:[e.jsx("strong",{children:r}),s]})}export{l as G};
1 change: 0 additions & 1 deletion web_viewer/public/assets/HourlyChart-BT0qjUZK.js

This file was deleted.

1 change: 1 addition & 0 deletions web_viewer/public/assets/HourlyChart-DXGyFKRM.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 23ab0fe

Please sign in to comment.