List of usage examples for org.jfree.data.xy CategoryTableXYDataset CategoryTableXYDataset
public CategoryTableXYDataset()
From source file:ru.spbspu.viewer.DataView.java
@Deprecated public void buildEnergyGraph2() { double[] data = _presenter.getFrameEnergy(getFramePosition(), getWindowWidth(), getWindowWidth()); CategoryTableXYDataset serie = new CategoryTableXYDataset(); serie.setNotify(false);/*from w w w .j av a 2 s. co m*/ double step = 1.0 / getDiscretization(); double startPosition = step * getFramePosition(); for (int i = 0; i < data.length - 1; i++) { serie.add(startPosition, data[i], ""); startPosition += step; //1.0 / getDiscretization() * getFrameWidth() / (data.length - 1); } JFreeChart chart = ChartFactory.createXYLineChart("", "", "", serie); chart.removeLegend(); chart.setAntiAlias(false); XYPlot plot = chart.getXYPlot(); org.jfree.chart.axis.ValueAxis yAxis = plot.getRangeAxis(); org.jfree.chart.axis.ValueAxis xAxis = plot.getDomainAxis(); double start = getFramePosition() * 1.0 / getDiscretization(); double max = start + getFrameWidth() * 1.0 / getDiscretization(); xAxis.setRange(start, max); ChartPanel chartPanel = new ChartPanel(chart); drawGraphOfEnergy(chartPanel); }
From source file:ru.spbspu.viewer.DataView.java
public void buildFullOscillogram() { CategoryTableXYDataset serie = new CategoryTableXYDataset(); serie.setNotify(false);// ww w .j av a2s .c o m double step = 1.0 / getDiscretization(); double startPosition = step * getFramePosition(); double[] data = _presenter.getFullData(); for (int i = 0; i < data.length; i++) { serie.add(startPosition, data[i], ""); startPosition += step; } JFreeChart chart = ChartFactory.createXYLineChart("", "t,c", "g, /c^2", serie); chart.removeLegend(); chart.setAntiAlias(false); XYPlot plot = chart.getXYPlot(); //plot.setRangeGridlinePaint(Color.BLACK); org.jfree.chart.axis.ValueAxis yAxis = plot.getRangeAxis(); yAxis.setRange(_presenter.getMinMaxRange()); org.jfree.chart.axis.ValueAxis xAxis = plot.getDomainAxis(); double start = getFramePosition() * 1.0 / getDiscretization(); double max = start + getFrameWidth() * 1.0 / getDiscretization(); xAxis.setRange(start, max); ChartPanel chartPanel = new ChartPanel(chart); drawGraphOfSignal(chartPanel); }