Java Code Examples for org.jfree.chart.renderer.category.LineAndShapeRenderer#setBaseLinesVisible()
The following examples show how to use
org.jfree.chart.renderer.category.LineAndShapeRenderer#setBaseLinesVisible() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DefaultChartTheme.java From jasperreports with GNU Lesser General Public License v3.0 | 4 votes |
protected JFreeChart createLineChart() throws JRException { ChartFactory.setChartTheme(StandardChartTheme.createLegacyTheme()); JFreeChart jfreeChart = ChartFactory.createLineChart( evaluateTextExpression(getChart().getTitleExpression()), evaluateTextExpression( ((JRLinePlot)getPlot()).getCategoryAxisLabelExpression()), evaluateTextExpression(((JRLinePlot)getPlot()).getValueAxisLabelExpression()), (CategoryDataset)getDataset(), getPlot().getOrientationValue().getOrientation(), isShowLegend(), true, false); configureChart(jfreeChart); CategoryPlot categoryPlot = (CategoryPlot)jfreeChart.getPlot(); JRLinePlot linePlot = (JRLinePlot)getPlot(); LineAndShapeRenderer lineRenderer = (LineAndShapeRenderer)categoryPlot.getRenderer(); boolean isShowShapes = linePlot.getShowShapes() == null ? true : linePlot.getShowShapes(); boolean isShowLines = linePlot.getShowLines() == null ? true : linePlot.getShowLines(); lineRenderer.setBaseShapesVisible( isShowShapes );//FIXMECHART check this lineRenderer.setBaseLinesVisible( isShowLines ); //FIXME labels? // Handle the axis formating for the category axis configureAxis(categoryPlot.getDomainAxis(), linePlot.getCategoryAxisLabelFont(), linePlot.getCategoryAxisLabelColor(), linePlot.getCategoryAxisTickLabelFont(), linePlot.getCategoryAxisTickLabelColor(), linePlot.getCategoryAxisTickLabelMask(), linePlot.getCategoryAxisVerticalTickLabels(), linePlot.getCategoryAxisLineColor(), false, (Comparable<?>)evaluateExpression(linePlot.getDomainAxisMinValueExpression()), (Comparable<?>)evaluateExpression(linePlot.getDomainAxisMaxValueExpression())); // Handle the axis formating for the value axis configureAxis(categoryPlot.getRangeAxis(), linePlot.getValueAxisLabelFont(), linePlot.getValueAxisLabelColor(), linePlot.getValueAxisTickLabelFont(), linePlot.getValueAxisTickLabelColor(), linePlot.getValueAxisTickLabelMask(), linePlot.getValueAxisVerticalTickLabels(), linePlot.getValueAxisLineColor(), true, (Comparable<?>)evaluateExpression(linePlot.getRangeAxisMinValueExpression()), (Comparable<?>)evaluateExpression(linePlot.getRangeAxisMaxValueExpression())); return jfreeChart; }
Example 2
Source File: GenericChartTheme.java From jasperreports with GNU Lesser General Public License v3.0 | 4 votes |
protected JFreeChart createLineChart() throws JRException { ChartFactory.setChartTheme(StandardChartTheme.createLegacyTheme()); JFreeChart freeChart = ChartFactory.createLineChart( evaluateTextExpression(getChart().getTitleExpression()), evaluateTextExpression( ((JRLinePlot)getPlot()).getCategoryAxisLabelExpression()), evaluateTextExpression(((JRLinePlot)getPlot()).getValueAxisLabelExpression()), (CategoryDataset)getDataset(), getPlot().getOrientationValue().getOrientation(), isShowLegend(), true, false); configureChart(freeChart, getPlot()); CategoryPlot categoryPlot = (CategoryPlot)freeChart.getPlot(); JRLinePlot linePlot = (JRLinePlot)getPlot(); LineAndShapeRenderer lineRenderer = (LineAndShapeRenderer)categoryPlot.getRenderer(); boolean isShowShapes = linePlot.getShowShapes() == null ? true : linePlot.getShowShapes(); boolean isShowLines = linePlot.getShowLines() == null ? true : linePlot.getShowLines(); lineRenderer.setBaseShapesVisible( isShowShapes );//FIXMECHART check this lineRenderer.setBaseLinesVisible( isShowLines ); //FIXME labels? // Handle the axis formating for the category axis configureAxis(categoryPlot.getDomainAxis(), linePlot.getCategoryAxisLabelFont(), linePlot.getCategoryAxisLabelColor(), linePlot.getCategoryAxisTickLabelFont(), linePlot.getCategoryAxisTickLabelColor(), linePlot.getCategoryAxisTickLabelMask(), linePlot.getCategoryAxisVerticalTickLabels(), linePlot.getOwnCategoryAxisLineColor(), false, (Comparable<?>)evaluateExpression(linePlot.getDomainAxisMinValueExpression()), (Comparable<?>)evaluateExpression(linePlot.getDomainAxisMaxValueExpression())); // Handle the axis formating for the value axis configureAxis(categoryPlot.getRangeAxis(), linePlot.getValueAxisLabelFont(), linePlot.getValueAxisLabelColor(), linePlot.getValueAxisTickLabelFont(), linePlot.getValueAxisTickLabelColor(), linePlot.getValueAxisTickLabelMask(), linePlot.getValueAxisVerticalTickLabels(), linePlot.getOwnValueAxisLineColor(), true, (Comparable<?>)evaluateExpression(linePlot.getRangeAxisMinValueExpression()), (Comparable<?>)evaluateExpression(linePlot.getRangeAxisMaxValueExpression())); return freeChart; }
Example 3
Source File: SimpleChartTheme.java From jasperreports with GNU Lesser General Public License v3.0 | 4 votes |
protected JFreeChart createLineChart() throws JRException { ChartFactory.setChartTheme(StandardChartTheme.createLegacyTheme()); JFreeChart freeChart = ChartFactory.createLineChart( evaluateTextExpression(getChart().getTitleExpression()), evaluateTextExpression( ((JRLinePlot)getPlot()).getCategoryAxisLabelExpression()), evaluateTextExpression(((JRLinePlot)getPlot()).getValueAxisLabelExpression()), (CategoryDataset)getDataset(), getPlot().getOrientationValue().getOrientation(), isShowLegend(), true, false); configureChart(freeChart, getPlot()); CategoryPlot categoryPlot = (CategoryPlot)freeChart.getPlot(); JRLinePlot linePlot = (JRLinePlot)getPlot(); LineAndShapeRenderer lineRenderer = (LineAndShapeRenderer)categoryPlot.getRenderer(); boolean isShowShapes = linePlot.getShowShapes() == null ? true : linePlot.getShowShapes(); boolean isShowLines = linePlot.getShowLines() == null ? true : linePlot.getShowLines(); lineRenderer.setBaseShapesVisible( isShowShapes );//FIXMECHART check this lineRenderer.setBaseLinesVisible( isShowLines ); //FIXME labels? // Handle the axis formating for the category axis configureAxis(categoryPlot.getDomainAxis(), linePlot.getCategoryAxisLabelFont(), linePlot.getCategoryAxisLabelColor(), linePlot.getCategoryAxisTickLabelFont(), linePlot.getCategoryAxisTickLabelColor(), linePlot.getCategoryAxisTickLabelMask(), linePlot.getCategoryAxisVerticalTickLabels(), linePlot.getOwnCategoryAxisLineColor(), getDomainAxisSettings(), (Comparable<?>)evaluateExpression(linePlot.getDomainAxisMinValueExpression()), (Comparable<?>)evaluateExpression(linePlot.getDomainAxisMaxValueExpression()) ); // Handle the axis formating for the value axis configureAxis(categoryPlot.getRangeAxis(), linePlot.getValueAxisLabelFont(), linePlot.getValueAxisLabelColor(), linePlot.getValueAxisTickLabelFont(), linePlot.getValueAxisTickLabelColor(), linePlot.getValueAxisTickLabelMask(), linePlot.getValueAxisVerticalTickLabels(), linePlot.getOwnValueAxisLineColor(), getRangeAxisSettings(), (Comparable<?>)evaluateExpression(linePlot.getRangeAxisMinValueExpression()), (Comparable<?>)evaluateExpression(linePlot.getRangeAxisMaxValueExpression()) ); return freeChart; }
Example 4
Source File: LineAndShapeRendererTests.java From astor with GNU General Public License v2.0 | 4 votes |
/** * Test that the equals() method distinguishes all fields. */ public void testEquals() { LineAndShapeRenderer r1 = new LineAndShapeRenderer(); LineAndShapeRenderer r2 = new LineAndShapeRenderer(); assertEquals(r1, r2); r1.setBaseLinesVisible(!r1.getBaseLinesVisible()); assertFalse(r1.equals(r2)); r2.setBaseLinesVisible(r1.getBaseLinesVisible()); assertTrue(r1.equals(r2)); r1.setSeriesLinesVisible(1, true); assertFalse(r1.equals(r2)); r2.setSeriesLinesVisible(1, true); assertTrue(r1.equals(r2)); r1.setBaseShapesVisible(!r1.getBaseShapesVisible()); assertFalse(r1.equals(r2)); r2.setBaseShapesVisible(r1.getBaseShapesVisible()); assertTrue(r1.equals(r2)); r1.setSeriesShapesVisible(1, true); assertFalse(r1.equals(r2)); r2.setSeriesShapesVisible(1, true); assertTrue(r1.equals(r2)); r1.setSeriesShapesFilled(1, true); assertFalse(r1.equals(r2)); r2.setSeriesShapesFilled(1, true); assertTrue(r1.equals(r2)); r1.setBaseShapesFilled(false); assertFalse(r1.equals(r2)); r2.setBaseShapesFilled(false); assertTrue(r1.equals(r2)); r1.setUseOutlinePaint(true); assertFalse(r1.equals(r2)); r2.setUseOutlinePaint(true); assertTrue(r1.equals(r2)); r1.setUseSeriesOffset(true); assertFalse(r1.equals(r2)); r2.setUseSeriesOffset(true); assertTrue(r1.equals(r2)); r1.setItemMargin(0.14); assertFalse(r1.equals(r2)); r2.setItemMargin(0.14); assertTrue(r1.equals(r2)); }
Example 5
Source File: LineAndShapeRendererTests.java From astor with GNU General Public License v2.0 | 4 votes |
/** * Checks that the two renderers are equal but independent of one another. * * @param r1 renderer 1. * @param r2 renderer 2. * * @return A boolean. */ private boolean checkIndependence(LineAndShapeRenderer r1, LineAndShapeRenderer r2) { // should be equal... if (!r1.equals(r2)) { return false; } // and independent... r1.setBaseLinesVisible(!r1.getBaseLinesVisible()); if (r1.equals(r2)) { return false; } r2.setBaseLinesVisible(r1.getBaseLinesVisible()); if (!r1.equals(r2)) { return false; } r1.setSeriesLinesVisible(1, true); if (r1.equals(r2)) { return false; } r2.setSeriesLinesVisible(1, true); if (!r1.equals(r2)) { return false; } r1.setBaseShapesVisible(!r1.getBaseShapesVisible()); if (r1.equals(r2)) { return false; } r2.setBaseShapesVisible(r1.getBaseShapesVisible()); if (!r1.equals(r2)) { return false; } r1.setSeriesShapesVisible(1, true); if (r1.equals(r2)) { return false; } r2.setSeriesShapesVisible(1, true); if (!r1.equals(r2)) { return false; } r1.setSeriesShapesFilled(0, false); r2.setSeriesShapesFilled(0, true); if (r1.equals(r2)) { return false; } r2.setSeriesShapesFilled(0, false); if (!r1.equals(r2)) { return false; } r1.setBaseShapesFilled(false); r2.setBaseShapesFilled(true); if (r1.equals(r2)) { return false; } r2.setBaseShapesFilled(false); if (!r1.equals(r2)) { return false; } return true; }
Example 6
Source File: LineAndShapeRendererTests.java From astor with GNU General Public License v2.0 | 4 votes |
/** * Test that the equals() method distinguishes all fields. */ public void testEquals() { LineAndShapeRenderer r1 = new LineAndShapeRenderer(); LineAndShapeRenderer r2 = new LineAndShapeRenderer(); assertEquals(r1, r2); r1.setBaseLinesVisible(!r1.getBaseLinesVisible()); assertFalse(r1.equals(r2)); r2.setBaseLinesVisible(r1.getBaseLinesVisible()); assertTrue(r1.equals(r2)); r1.setSeriesLinesVisible(1, true); assertFalse(r1.equals(r2)); r2.setSeriesLinesVisible(1, true); assertTrue(r1.equals(r2)); r1.setBaseShapesVisible(!r1.getBaseShapesVisible()); assertFalse(r1.equals(r2)); r2.setBaseShapesVisible(r1.getBaseShapesVisible()); assertTrue(r1.equals(r2)); r1.setSeriesShapesVisible(1, true); assertFalse(r1.equals(r2)); r2.setSeriesShapesVisible(1, true); assertTrue(r1.equals(r2)); r1.setSeriesShapesFilled(1, true); assertFalse(r1.equals(r2)); r2.setSeriesShapesFilled(1, true); assertTrue(r1.equals(r2)); r1.setBaseShapesFilled(false); assertFalse(r1.equals(r2)); r2.setBaseShapesFilled(false); assertTrue(r1.equals(r2)); r1.setUseOutlinePaint(true); assertFalse(r1.equals(r2)); r2.setUseOutlinePaint(true); assertTrue(r1.equals(r2)); r1.setUseSeriesOffset(true); assertFalse(r1.equals(r2)); r2.setUseSeriesOffset(true); assertTrue(r1.equals(r2)); r1.setItemMargin(0.14); assertFalse(r1.equals(r2)); r2.setItemMargin(0.14); assertTrue(r1.equals(r2)); }
Example 7
Source File: LineAndShapeRendererTests.java From astor with GNU General Public License v2.0 | 4 votes |
/** * Checks that the two renderers are equal but independent of one another. * * @param r1 renderer 1. * @param r2 renderer 2. * * @return A boolean. */ private boolean checkIndependence(LineAndShapeRenderer r1, LineAndShapeRenderer r2) { // should be equal... if (!r1.equals(r2)) { return false; } // and independent... r1.setBaseLinesVisible(!r1.getBaseLinesVisible()); if (r1.equals(r2)) { return false; } r2.setBaseLinesVisible(r1.getBaseLinesVisible()); if (!r1.equals(r2)) { return false; } r1.setSeriesLinesVisible(1, true); if (r1.equals(r2)) { return false; } r2.setSeriesLinesVisible(1, true); if (!r1.equals(r2)) { return false; } r1.setBaseShapesVisible(!r1.getBaseShapesVisible()); if (r1.equals(r2)) { return false; } r2.setBaseShapesVisible(r1.getBaseShapesVisible()); if (!r1.equals(r2)) { return false; } r1.setSeriesShapesVisible(1, true); if (r1.equals(r2)) { return false; } r2.setSeriesShapesVisible(1, true); if (!r1.equals(r2)) { return false; } r1.setSeriesShapesFilled(0, false); r2.setSeriesShapesFilled(0, true); if (r1.equals(r2)) { return false; } r2.setSeriesShapesFilled(0, false); if (!r1.equals(r2)) { return false; } r1.setBaseShapesFilled(false); r2.setBaseShapesFilled(true); if (r1.equals(r2)) { return false; } r2.setBaseShapesFilled(false); if (!r1.equals(r2)) { return false; } return true; }