use of org.jfree.chart.axis.ValueAxis in project SIMVA-SoS by SESoS.
the class TimeSeriesChartTest method testReplaceDataset.
/**
* Replaces the dataset and checks that it has changed as expected.
*/
@Test
public void testReplaceDataset() {
// create a dataset...
XYSeries series1 = new XYSeries("Series 1");
series1.add(10.0, 10.0);
series1.add(20.0, 20.0);
series1.add(30.0, 30.0);
XYDataset dataset = new XYSeriesCollection(series1);
LocalListener l = new LocalListener();
this.chart.addChangeListener(l);
XYPlot plot = (XYPlot) this.chart.getPlot();
plot.setDataset(dataset);
assertEquals(true, l.flag);
ValueAxis axis = plot.getRangeAxis();
Range range = axis.getRange();
assertTrue("Expecting the lower bound of the range to be around 10: " + range.getLowerBound(), range.getLowerBound() <= 10);
assertTrue("Expecting the upper bound of the range to be around 30: " + range.getUpperBound(), range.getUpperBound() >= 30);
}
use of org.jfree.chart.axis.ValueAxis in project SIMVA-SoS by SESoS.
the class XYLineChartTest method testReplaceDataset.
/**
* Replaces the dataset and checks that it has changed as expected.
*/
@Test
public void testReplaceDataset() {
// create a dataset...
XYSeries series1 = new XYSeries("Series 1");
series1.add(10.0, 10.0);
series1.add(20.0, 20.0);
series1.add(30.0, 30.0);
XYDataset dataset = new XYSeriesCollection(series1);
LocalListener l = new LocalListener();
this.chart.addChangeListener(l);
XYPlot plot = (XYPlot) this.chart.getPlot();
plot.setDataset(dataset);
assertEquals(true, l.flag);
ValueAxis axis = plot.getRangeAxis();
Range range = axis.getRange();
assertTrue("Expecting the lower bound of the range to be around 10: " + range.getLowerBound(), range.getLowerBound() <= 10);
assertTrue("Expecting the upper bound of the range to be around 30: " + range.getUpperBound(), range.getUpperBound() >= 30);
}
use of org.jfree.chart.axis.ValueAxis in project SIMVA-SoS by SESoS.
the class XYBarChartTest method testReplaceDataset.
/**
* Replaces the dataset and checks that it has changed as expected.
*/
@Test
public void testReplaceDataset() {
// create a dataset...
XYSeries series1 = new XYSeries("Series 1");
series1.add(10.0, 10.0);
series1.add(20.0, 20.0);
series1.add(30.0, 30.0);
XYDataset dataset = new XYSeriesCollection(series1);
LocalListener l = new LocalListener();
this.chart.addChangeListener(l);
XYPlot plot = (XYPlot) this.chart.getPlot();
plot.setDataset(dataset);
assertEquals(true, l.flag);
ValueAxis axis = plot.getRangeAxis();
Range range = axis.getRange();
assertTrue("Expecting the lower bound of the range to be around 10: " + range.getLowerBound(), range.getLowerBound() <= 10);
assertTrue("Expecting the upper bound of the range to be around 30: " + range.getUpperBound(), range.getUpperBound() >= 30);
}
use of org.jfree.chart.axis.ValueAxis in project SIMVA-SoS by SESoS.
the class XYStepAreaChartTest method testReplaceDataset.
/**
* Replaces the dataset and checks that it has changed as expected.
*/
@Test
public void testReplaceDataset() {
// create a dataset...
XYSeries series1 = new XYSeries("Series 1");
series1.add(10.0, 10.0);
series1.add(20.0, 20.0);
series1.add(30.0, 30.0);
XYDataset dataset = new XYSeriesCollection(series1);
LocalListener l = new LocalListener();
this.chart.addChangeListener(l);
XYPlot plot = (XYPlot) this.chart.getPlot();
plot.setDataset(dataset);
assertEquals(true, l.flag);
ValueAxis axis = plot.getRangeAxis();
Range range = axis.getRange();
assertTrue("Expecting the lower bound of the range to be around 10: " + range.getLowerBound(), range.getLowerBound() <= 10);
assertTrue("Expecting the upper bound of the range to be around 30: " + range.getUpperBound(), range.getUpperBound() >= 30);
}
use of org.jfree.chart.axis.ValueAxis in project SIMVA-SoS by SESoS.
the class CombinedCategoryPlot method add.
/**
* Adds a new subplot with the specified weight.
*
* @param subplot the subplot.
* @param weight the weight for the subplot.
*/
public void add(CategoryPlot subplot, int weight) {
super.add(subplot, weight);
ValueAxis l_range = super.getRangeAxis();
subplot.setRangeAxis(0, l_range, false);
super.setRangeAxis(l_range);
if (null == l_range) {
return;
}
l_range.configure();
}
Aggregations