mirror of https://github.com/rusefi/RomRaider.git
updated graph view - incomplete
git-svn-id: http://svn.3splooges.com/romraider-arch/trunk@548 d2e2e1cd-ba16-0410-be16-b7c4453c7c2d
This commit is contained in:
parent
9f4e55bbbb
commit
b75d2b2295
|
@ -140,8 +140,10 @@ public final class GraphUpdateHandler implements DataUpdateHandler, ConvertorUpd
|
||||||
|
|
||||||
private synchronized void addToCombined(EcuData ecuData) {
|
private synchronized void addToCombined(EcuData ecuData) {
|
||||||
if (combinedChartPanel == null) {
|
if (combinedChartPanel == null) {
|
||||||
combinedChartPanel = new ChartPanel(createXYLineChart(ecuData, null, false), false, true, true, true, true);
|
combinedChartPanel = new ChartPanel(createXYLineChart(ecuData, null, true), false, true, true, true, true);
|
||||||
combinedChartPanel.getChart().addLegend(new LegendTitle(combinedChartPanel.getChart().getXYPlot()));
|
LegendTitle legendTitle = new LegendTitle(combinedChartPanel.getChart().getXYPlot());
|
||||||
|
legendTitle.setItemPaint(WHITE);
|
||||||
|
combinedChartPanel.getChart().addLegend(legendTitle);
|
||||||
combinedChartPanel.setMinimumSize(new Dimension(500, 400));
|
combinedChartPanel.setMinimumSize(new Dimension(500, 400));
|
||||||
combinedChartPanel.setPreferredSize(new Dimension(500, 400));
|
combinedChartPanel.setPreferredSize(new Dimension(500, 400));
|
||||||
graphPanel.add(combinedChartPanel);
|
graphPanel.add(combinedChartPanel);
|
||||||
|
@ -222,12 +224,13 @@ public final class GraphUpdateHandler implements DataUpdateHandler, ConvertorUpd
|
||||||
seriesMap.put(ecuData, series);
|
seriesMap.put(ecuData, series);
|
||||||
}
|
}
|
||||||
|
|
||||||
private JFreeChart createXYLineChart(EcuData ecuData, XYDataset dataset, boolean showLegend) {
|
private JFreeChart createXYLineChart(EcuData ecuData, XYDataset dataset, boolean combined) {
|
||||||
final JFreeChart chart = ChartFactory.createXYLineChart(ecuData.getName(), "Time (sec)", buildRangeAxisTitle(ecuData), dataset,
|
String title = combined ? "Combined Data" : ecuData.getName();
|
||||||
VERTICAL, showLegend, true, false);
|
String rangeAxisTitle = combined ? "Data" : buildRangeAxisTitle(ecuData);
|
||||||
|
JFreeChart chart = ChartFactory.createXYLineChart(title, "Time (sec)", rangeAxisTitle, dataset, VERTICAL, false, true, false);
|
||||||
chart.setBackgroundPaint(BLACK);
|
chart.setBackgroundPaint(BLACK);
|
||||||
chart.getTitle().setPaint(WHITE);
|
chart.getTitle().setPaint(WHITE);
|
||||||
final XYPlot plot = chart.getXYPlot();
|
XYPlot plot = chart.getXYPlot();
|
||||||
plot.setBackgroundPaint(BLACK);
|
plot.setBackgroundPaint(BLACK);
|
||||||
plot.getDomainAxis().setLabelPaint(WHITE);
|
plot.getDomainAxis().setLabelPaint(WHITE);
|
||||||
plot.getRangeAxis().setLabelPaint(WHITE);
|
plot.getRangeAxis().setLabelPaint(WHITE);
|
||||||
|
|
Loading…
Reference in New Issue