Skip to content

Commit

Permalink
Reduce padding in energy charts and align unit (#24095)
Browse files Browse the repository at this point in the history
  • Loading branch information
MindFreeze authored Feb 6, 2025
1 parent 79b9f8d commit bdbc9bc
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
13 changes: 8 additions & 5 deletions src/panels/lovelace/cards/energy/common/energy-chart-options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,10 @@ export function getCommonOptions(
yAxis: {
type: "value",
name: unit,
nameGap: 5,
nameGap: 2,
nameTextStyle: {
align: "left",
},
axisLabel: {
formatter: (value: number) => formatNumber(Math.abs(value), locale),
},
Expand All @@ -81,10 +84,10 @@ export function getCommonOptions(
},
},
grid: {
top: 35,
bottom: 10,
left: 10,
right: 10,
top: 15,
bottom: 0,
left: 1,
right: 1,
containLabel: true,
},
tooltip: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,9 +193,10 @@ export class HuiEnergyDevicesDetailGraphCard
icon: "circle",
},
grid: {
top: 45,
bottom: 0,
left: 5,
right: 5,
left: 1,
right: 1,
containLabel: true,
},
};
Expand Down

0 comments on commit bdbc9bc

Please sign in to comment.