Skip to content

Commit

Permalink
Remove the legend stuff on RTT stats
Browse files Browse the repository at this point in the history
It doesn't work.
  • Loading branch information
zapek committed Jan 3, 2025
1 parent b07da17 commit e63531a
Showing 1 changed file with 0 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,9 @@
import io.xeres.ui.controller.Controller;
import javafx.application.Platform;
import javafx.fxml.FXML;
import javafx.scene.Cursor;
import javafx.scene.chart.LineChart;
import javafx.scene.chart.NumberAxis;
import javafx.scene.chart.XYChart;
import javafx.scene.control.Label;
import net.rgielen.fxweaver.core.FxmlView;
import org.springframework.stereotype.Component;

Expand Down Expand Up @@ -118,29 +116,9 @@ private XYChart.Series<Number, Number> createSeries(RttPeer rttPeer)
var series = new XYChart.Series<Number, Number>();
series.setName(rttPeer.name());
lineChart.getData().add(series);
setLegend();
return series;
}

private void setLegend()
{
lineChart.lookupAll("Label.chart-legend-item").forEach(node -> {
if (node instanceof Label label && label.getCursor() == null) // Make sure we only do the job once for each
{
label.setCursor(Cursor.HAND);
label.setOnMouseClicked(event -> {
label.setOpacity(label.getOpacity() > 0.75 ? 0.5 : 1.0);
lineChart.getData().forEach(series -> {
if (series.getName().equals(label.getText()))
{
series.getNode().setVisible(!series.getNode().isVisible());
}
});
});
}
});
}

private static void updateData(XYChart.Series<Number, Number> series, float value)
{
series.getData().forEach(numberNumberData -> numberNumberData.setXValue(numberNumberData.getXValue().intValue() - UPDATE_IN_SECONDS));
Expand Down

0 comments on commit e63531a

Please sign in to comment.