-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[DRAFT] New Report Design #12
base: main
Are you sure you want to change the base?
Conversation
Catch up from main fork
<style> | ||
.charts-container { | ||
display: flex; | ||
flex-wrap: wrap; | ||
justify-content: space-around; | ||
} | ||
|
||
.chart-wrapper { | ||
flex: 0 0 800px; /* Adjust this value based on your desired width, leaving room for margins */ | ||
margin-bottom: 10px; /* Space between rows */ | ||
} | ||
</style> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<meta charset="utf-8"> | ||
</head> | ||
<body style="height: 100%; margin: 0; background-color:#100C2A"> | ||
<script type="text/javascript" src="https://fastly.jsdelivr.net/npm/echarts@5.4.3/dist/echarts.min.js"></script> | ||
|
||
<p style="color:#fff; font-size: large; text-align:center; margin: 0">Daikin Dashboard</p> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a little header to make it feel less naked and cramped at the top, since I removed the other date headers.
} | ||
}, | ||
], | ||
dataZoom: [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
}; | ||
|
||
chart.setOption(option); | ||
chart.group = 'ChartGroup1' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alternatively: An option is to use the tooltip but make it more subtle. I like this option quite a bit and am going to commit it to the branch :).
Here is the config for the following image.
This removes the horizontal crosshair to reduce noise, reducing padding to reduce size, uses a dark background and light text so it is less glaring. I also added units to it as a bonus.
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'cross',
axis: 'x',
},
valueFormatter: (value) => value + ' {{.YAxisUnit}}',
backgroundColor: '#19143a',
borderColor: '#333',
padding: 3,
textStyle: {
color: '#ccc',
},
},
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
) | ||
|
||
|
||
const deviceId = "FILL ME IN" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aside: I'd like to move deviceId to the config file so I can reference it in tests (like db below) to avoid this placeholder. But I've been putting that off to avoid this PR getting too big.
@@ -16,7 +16,15 @@ type Chart struct { | |||
TemperatureUnit string | |||
} | |||
|
|||
type ChartV2 struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A number of places I made a V2 of existing components. This is because I didn't want the PR to be destructive. Lemme know if this is a fine strategy.
panic(err) | ||
} | ||
|
||
periods[i].Period = t.Format("Jan 02 15:04") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!
Based on discussion here: #10
Note this is based off another existing branch where I added new fields. I can merge them separately or discard that one and continue with this "all-in-one" PR.