Subject: | Request to add visibility toggle in TimeSeries graphs |
Adding support for toggling paths on TimeSeries graphs. Clicking on the
key will hide/display the associated data path.
Subject: | toggle_paths-TimeSeries.pm.patch |
429c429
<
---
>
880a881,897
>
> <!-- Script to toggle paths when their key is clicked on -->
> <script language="JavaScript">
> function togglePath( series ) {
> var path = document.getElementById('groupDataSeries' + series)
> var points = document.getElementById('groupDataLabels' + series)
> var current = path.getAttribute('opacity');
> if ( path.getAttribute('opacity') == 0 ) {
> path.setAttribute('opacity',1)
> points.setAttribute('opacity',1)
> } else {
> path.setAttribute('opacity',0)
> points.setAttribute('opacity',0)
> }
> }
> </script>
>
1181c1198
< <rect x="[% x + w + 20 %]" y="[% y + (key_box_size * key_count) + (key_count * key_padding) %]" width="[% key_box_size %]" height="[% key_box_size %]" class="key[% key_count %]"/>
---
> <rect x="[% x + w + 20 %]" y="[% y + (key_box_size * key_count) + (key_count * key_padding) %]" width="[% key_box_size %]" height="[% key_box_size %]" class="key[% key_count %]" onclick="togglePath([% key_count %]);"/>
1205,1206c1222
< <rect x="[% x_key %]" y="[% y_key + (key_box_size * key_count) + (key_count * key_padding) + stagger %]" width="[% key_box_size %]" height="[% key_box_size %]" class="key[% key_count %]"/>
<
---
> <rect x="[% x_key %]" y="[% y_key + (key_box_size * key_count) + (key_count * key_padding) + stagger %]" width="[% key_box_size %]" height="[% key_box_size %]" class="key[% key_count %]" onclick="togglePath([% key_count %]);"/>