- edited description
Hiding series in charts
When plotting a series per system it can be time consuming to whittle down to the show only the series you want. Would it be possible to have a “hide series” button, so the series can then be switched on as needed?
@dplatten has some suggested code that seems to work nicely:
<a onclick="$($('#histogramAcquisitionPlotDLPdiv').highcharts().series).each(function(){this.hide()})" class="btn btn-default btn-sm" role="button">Hide all series</a>
<a onclick="$($('#histogramAcquisitionPlotDLPdiv').highcharts().series).each(function(){this.show()})" class="btn btn-default btn-sm" role="button">Show all series</a>
<a onclick="$($('#histogramAcquisitionPlotDLPdiv').highcharts().series).each(function(){if (this.visible) {this.hide();} else {this.show()}})" class="btn btn-default btn-sm" role="button">Toggle all series</a>
Comments (18)
-
reporter -
Addressed in pull request #102
-
Add hide/show series buttons
For all histogram charts a hide, show and toggle button is added to selectively hide/show/toggle all series. "Toggle Series" sets the unselected series to be activated and selected series to be deactivated. References issue
#537.→ <<cset 1e13d59cdad0>>
-
Merged in bearner/openrem/issue537chartsHideSeries (pull request #102) so that it can be reviewed. Refs
#537issue537chartsHideSeries
→ <<cset 60b69f903dbc>>
-
@edmcdonagh and @bearner, it should be easy enough to hide the buttons if there's only one series being plotted. I'll put some code together and commit it.
-
Changed CT filtered page to only show
Hide
,Show
andToggle
series buttons if there is more than one series on the chart. Also implemented code so that only one of theHide all
orShow all
buttons is showing at any one time. Also moved a couple of duplicate JavaScript functions to a file. References issue#537and#536→ <<cset d91da62cbabf>>
-
@edmcdonagh and @bearner, http://testing.openrem.org has my changes live. I've only updated the code on the CT page. If you plot a chart with "Plot a series per system" unchecked then the "Hide the series" buttons are not displayed at all. If you check the "Plot a series per system" box then you will see the "Hide the series" buttons.
Let me know what you think.
As an aside, you have to choose "Mean" rather than "Median" as the median database function isn't working on the test site.
-
Addressing some codacy issues from the previous commit. References issue
#526and issue#537→ <<cset e403a1ea913d>>
-
Merged in issue537chartsHideSeries (pull request #105)
Addressing some codacy issues from the previous commit. References issue
#526and issue#537→ <<cset 7fba25484c5d>>
-
Switching debug off - didn't mean to commit this change. References issue
#537→ <<cset 5908b1dfd014>>
-
Merged in issue537chartsHideSeries (pull request #106)
Switching debug off - didn't mean to commit this change. References issue
#537→ <<cset 0ca786bda0c2>>
-
reporter It looks good to me when playing around with it. The buttons are there when you need them, but not distracting when you don't want to/can't use them. Very neat!
-
Thanks for the comments Ben. I'll make similar changes to the other filtered pages and commit them too.
-
Updated DX, MG and RF charts with the new
Hide series
code. References issue#537→ <<cset d60af521d513>>
-
Merged in issue537chartsHideSeries (pull request #107)
Updated DX, MG and RF charts with the new
Hide series
code. References issue#537→ <<cset b61afa3c8e78>>
-
The visibility of the new
Hide...
,Show...
andToggle...
series buttons are now changed as appropriate when a user drills down to histograms. References issue#537→ <<cset daf0f97436f1>>
-
Merged in issue537chartsHideSeries (pull request #108)
The visibility of the new
Hide...
,Show...
andToggle...
series buttons are now changed as appropriate when a user drills down to histograms. References issue#537→ <<cset a9f23cba7b86>>
-
- changed status to resolved
Fixed and pulled into develop with pull request #108
- Log in to comment