Skip to content
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

(BIDS-652) add hide all series button #2637

Merged
merged 2 commits into from
Nov 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion templates/pools/charts.html
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@
<script>
// source: https://stackoverflow.com/questions/63343645/overriding-log-scale-with-highcharts-export-server/63375446#63375446
window.addEventListener('load', function () {
Highcharts.stockChart('performance-chart', {
performanceChart = Highcharts.stockChart('performance-chart', {
chart: {
type: {{.HistoricPoolPerformance.Data.Type}},
borderColor: null,
Expand Down
33 changes: 33 additions & 0 deletions templates/pools/pools.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,26 @@
<script src="/js/highcharts/highcharts-global-options.js"></script>
<script src="/js/luxon.min.js"></script>
<script>
let performanceChart
if (window.location.hash == "#performance") {
$("#distribution-chart").addClass("d-none")
$("#performance-chart").removeClass("d-none")
$("#performance-chart-btn-hide-all").removeClass("d-none")
}
$("#distribution-chart-btn").on("click", () => {
$("#distribution-chart").removeClass("d-none")
$("#performance-chart").addClass("d-none")
$("#performance-chart-btn-hide-all").addClass("d-none")
})
$("#performance-chart-btn").on("click", () => {
$("#distribution-chart").addClass("d-none")
$("#performance-chart").removeClass("d-none")
$("#performance-chart-btn-hide-all").removeClass("d-none")
})
$("#performance-chart-btn-hide-all").on("click", () => {
performanceChart.series.forEach((series) => {
series.setVisible(false, false)
})
LuccaBitfly marked this conversation as resolved.
Show resolved Hide resolved
})
</script>
{{ end }}
Expand All @@ -25,6 +34,23 @@
<style>
#charts-container {
height: 520px;
position: relative;
}
@media (min-width: 817.96px) {
#performance-chart-btn-hide-all {
position: absolute;
right: 0px;
bottom: 55px;
}
}

@media (max-width: 818px) {
#charts-container {
height: 560px;
}
#performance-chart-btn-hide-all {
position: relative;
}
}
</style>
{{ end }}
Expand All @@ -40,6 +66,13 @@
<div id="performance-chart" class="w-100 mb-2 d-none">
{{ template "performance_chart" .Data }}
</div>
<div class="text-center">
<button class="btn btn-primary btn-sm d-none" id="performance-chart-btn-hide-all">
<span class="text-white">
<b>Hide all</b>
</span>
</button>
</div>
</div>
<div class="d-flex justify-content-center btn-group border rounded w-25 m-auto">
<a role="button" class="btn border-right" id="distribution-chart-btn" href="#distribution">
Expand Down
Loading