Skip to content
Snippets Groups Projects
Commit fd973abb authored by Tim Molter's avatar Tim Molter
Browse files

allowed for date X-Axis types for real-time plots

parent 5c725fc7
No related branches found
No related tags found
No related merge requests found
......@@ -79,7 +79,6 @@ public class RealtimeChart01 implements ExampleChart {
public XChartPanel buildPanel() {
yData = getRandomData(5);
return new XChartPanel(getChart());
}
......
......@@ -34,7 +34,6 @@ import com.xeiam.xchart.demo.charts.ExampleChart;
public class RealtimeChart02 implements ExampleChart {
private Chart chart;
// private XChartPanel chartPanel;
public static final String SERIES_NAME = "series1";
private List<Integer> xData;
private List<Double> yData;
......@@ -82,9 +81,6 @@ public class RealtimeChart02 implements ExampleChart {
public XChartPanel buildPanel() {
yData = getRandomData(5);
xData = getMonotonicallyIncreasingData(5);
return new XChartPanel(getChart());
}
......
......@@ -303,7 +303,7 @@ public class Series {
return name;
}
void replaceXData(List<? extends Number> newXData) {
void replaceXData(List<?> newXData) {
xData = newXData;
calculateMinMax();
......
......@@ -249,8 +249,9 @@ public class XChartPanel extends JPanel {
*
* @param seriesName
* @param newYData
* @return
*/
public void updateSeries(String seriesName, List<? extends Number> newYData) {
public Series updateSeries(String seriesName, List<? extends Number> newYData) {
Series series = chart.getSeriesMap().get(seriesName);
if (series == null) {
......@@ -268,6 +269,8 @@ public class XChartPanel extends JPanel {
// Re-display the chart
revalidate();
repaint();
return series;
}
/**
......@@ -275,8 +278,9 @@ public class XChartPanel extends JPanel {
*
* @param seriesName
* @param newYData
* @return
*/
public void updateSeries(String seriesName, List<? extends Number> newXData, List<? extends Number> newYData) {
public Series updateSeries(String seriesName, List<?> newXData, List<? extends Number> newYData) {
Series series = chart.getSeriesMap().get(seriesName);
if (series == null) {
......@@ -288,5 +292,7 @@ public class XChartPanel extends JPanel {
// Re-display the chart
revalidate();
repaint();
return series;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment