Commit ef76d507 authored by Xiaowu Zhang's avatar Xiaowu Zhang

ors_wendelin: hide/show group trace together

parent 7b26b31b
...@@ -51,6 +51,7 @@ ...@@ -51,6 +51,7 @@
type: 'scatter', type: 'scatter',
line: color, line: color,
name: 'IPThp.' + i, name: 'IPThp.' + i,
legendgroup: 'legendgroup' + i,
hovertemplate: 'Date: %{x}<br>Download: %{y} Mbit/s' hovertemplate: 'Date: %{x}<br>Download: %{y} Mbit/s'
}); });
data_list.push({ data_list.push({
...@@ -62,6 +63,7 @@ ...@@ -62,6 +63,7 @@
opacity: 0.3, opacity: 0.3,
showlegend: false, showlegend: false,
fill: 'tonexty', fill: 'tonexty',
legendgroup: 'legendgroup' + i,
hoverinfo: 'none' hoverinfo: 'none'
}); });
} }
...@@ -98,7 +100,9 @@ ...@@ -98,7 +100,9 @@
raw_dl_lo, raw_dl_lo,
raw_dl_hi, raw_dl_hi,
raw_ul_lo, raw_ul_lo,
raw_ul_hi; raw_ul_hi,
download_link = gadget.element.querySelector('.download-link'),
upload_link = gadget.element.querySelector('.upload-link');
for (i = 0; i < graph_data.length; i += 1) { for (i = 0; i < graph_data.length; i += 1) {
if (date.indexOf(graph_data[i][0]) == -1) { if (date.indexOf(graph_data[i][0]) == -1) {
date.push(graph_data[i][0]); date.push(graph_data[i][0]);
...@@ -131,7 +135,7 @@ ...@@ -131,7 +135,7 @@
download_data = getPlotData(dl_lo, dl_hi, date); download_data = getPlotData(dl_lo, dl_hi, date);
upload_data = getPlotData(ul_lo, ul_hi, date); upload_data = getPlotData(ul_lo, ul_hi, date);
Plotly.newPlot( Plotly.newPlot(
gadget.element.querySelector('.download-link'), download_link,
download_data, download_data,
{ {
/* /*
...@@ -157,7 +161,7 @@ ...@@ -157,7 +161,7 @@
); );
Plotly.newPlot( Plotly.newPlot(
gadget.element.querySelector('.upload-link'), upload_link,
upload_data, upload_data,
{ {
/* /*
......
...@@ -242,7 +242,7 @@ ...@@ -242,7 +242,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>1007.32864.56533.30259</string> </value> <value> <string>1007.34352.37418.49595</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -262,7 +262,7 @@ ...@@ -262,7 +262,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1680610637.0</float> <float>1680699889.54</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment