[Schmitzm-commits] r274 - trunk/src/schmitzm/jfree/chart/style

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Sat Aug 1 20:02:41 CEST 2009


Author: mojays
Date: 2009-08-01 20:02:40 +0200 (Sat, 01 Aug 2009)
New Revision: 274

Modified:
   trunk/src/schmitzm/jfree/chart/style/BasicChartStyle.java
Log:


Modified: trunk/src/schmitzm/jfree/chart/style/BasicChartStyle.java
===================================================================
--- trunk/src/schmitzm/jfree/chart/style/BasicChartStyle.java	2009-08-01 17:58:16 UTC (rev 273)
+++ trunk/src/schmitzm/jfree/chart/style/BasicChartStyle.java	2009-08-01 18:02:40 UTC (rev 274)
@@ -231,7 +231,9 @@
       chart.getCategoryPlot().setRenderer( JFreeChartUtil.createCategoryRenderer(this) );
     else
       LOGGER.warn("Properties of BasicChartStyle can not be applied to plot: "+chart.getPlot());
-
+    // Note: It is important that the super-apply comes after
+    //       the upper stuff, so that changes on the renderer
+    //       effect the new (special stacked/stepped) renderer!!
     super.applyToChart(chart);
   }
   
@@ -245,38 +247,24 @@
     // XYDataset -> XYLineChart
     if (dataset instanceof XYDataset) {
       chart = ChartFactory.createXYLineChart(
-          "title",
-          "xAxis",
-          "yAxis",
-//          getTitleStyle().getLabel(),
-//          getAxisStyle(DOMAIN_AXIS).getLabel(),
-//          getAxisStyle(RANGE_AXIS).getLabel(),
+          null,null,null, // Title and axis will be configured in applyToChart(..)
           (XYDataset)dataset,
           orientation,
           legend,
           tooltips,
           urls
       );
-//      if ( stepped )
-//        chart.getXYPlot().setRenderer( new XYStepRenderer() );
     }
     // CategoryDataset -> LineChart
     if (dataset instanceof CategoryDataset) {
       chart = ChartFactory.createLineChart(
-              "title",
-              "xAxis",
-              "yAxis",
-//              getTitleStyle().getLabel(),
-//              getAxisStyle(DOMAIN_AXIS).getLabel(),
-//              getAxisStyle(RANGE_AXIS).getLabel(),
+          null,null,null, // Title and axis will be configured in applyToChart(..)
           (CategoryDataset)dataset,
           orientation,
           legend,
           tooltips,
           urls
       );
-//      if ( stepped )
-//        chart.getCategoryPlot().setRenderer(  new CategoryStepRenderer() );
     }
     return chart;
   }
@@ -290,49 +278,24 @@
     // XYDataset -> XYAreaChart
     if (dataset instanceof XYDataset) {
       chart = ChartFactory.createXYAreaChart(
-              "title",
-              "xAxis",
-              "yAxis",
-//              getTitleStyle().getLabel(),
-//              getAxisStyle(DOMAIN_AXIS).getLabel(),
-//              getAxisStyle(RANGE_AXIS).getLabel(),
+          null,null,null, // Title and axis will be configured in applyToChart(..)
           (XYDataset) dataset,
           orientation,
           legend,
           tooltips,
           urls
           );
-//      if (stacked) {
-//        if (dataset instanceof TableXYDataset)
-//          chart.getXYPlot().setRenderer(new StackedXYAreaRenderer2());
-//        else
-//          throw new UnsupportedOperationException("Chart creation: Stacked area charts can not be applied on XYDataset. TableXYDataset needed!");
-//        if (stepped)
-//          throw new UnsupportedOperationException("Chart creation: A stacked area chart can not be stepped the same time. Use a stacked bar chart instead!");
-//      } else  {
-//        if (stepped)
-//          chart.getXYPlot().setRenderer(new XYStepAreaRenderer(XYStepAreaRenderer.AREA));
-//      }
     }
     // CategoryDataset -> AreaChart
     if (dataset instanceof CategoryDataset) {
       chart = ChartFactory.createAreaChart(
-              "title",
-              "xAxis",
-              "yAxis",
-//              getTitleStyle().getLabel(),
-//              getAxisStyle(DOMAIN_AXIS).getLabel(),
-//              getAxisStyle(RANGE_AXIS).getLabel(),
+          null,null,null, // Title and axis will be configured in applyToChart(..)
           (CategoryDataset)dataset,
           orientation,
           legend,
           tooltips,
           urls
       );
-//      if ( stepped )
-//        throw new UnsupportedOperationException("Chart creation: Stepped area style can not be applied on CategoryDataset. Use a bar chart instead!");
-//      if ( stacked )
-//        chart.getCategoryPlot().setRenderer(  new StackedAreaRenderer(false) );
     }
 
     return chart;
@@ -347,44 +310,24 @@
     // XYDataset -> XYBarChart
     if (dataset instanceof XYDataset) {
       chart = ChartFactory.createXYBarChart(
-              "title",
-              "xAxis",
-              false,
-              "yAxis",
-//    		  getTitleStyle().getLabel(),
-//          getAxisStyle(DOMAIN_AXIS).getLabel(),
-//          false,
-//          getAxisStyle(RANGE_AXIS).getLabel(),
+          null,null,false,null, // Title and axis will be configured in applyToChart(..)
           (IntervalXYDataset)(dataset instanceof TableXYDataset ? (TableXYDataset)dataset : new XYBarDataset( (XYDataset) dataset, 0.5d)),
           PlotOrientation.VERTICAL,
           true,
           true,
           true
       );
-//      if ( stacked ) {
-//        if ( dataset instanceof TableXYDataset )
-//          chart.getXYPlot().setRenderer(new StackedXYBarRenderer());
-//        else
-//          throw new UnsupportedOperationException("Chart creation: Stacked bar charts can not be applied on XYDataset. TableXYDataset needed!");
-//      }
     }
     // CategoryDataset -> BarChart
     if (dataset instanceof CategoryDataset) {
       chart = ChartFactory.createBarChart(
-              "title",
-              "xAxis",
-              "yAxis",
-//              getTitleStyle().getLabel(),
-//              getAxisStyle(DOMAIN_AXIS).getLabel(),
-//              getAxisStyle(RANGE_AXIS).getLabel(),
+          null,null,null, // Title and axis will be configured in applyToChart(..)
           (CategoryDataset)dataset,
           orientation,
           legend,
           tooltips,
           urls
       );
-//      if ( stacked )
-//        chart.getCategoryPlot().setRenderer(  new StackedBarRenderer(false) );
     }
 
     return chart;



More information about the Schmitzm-commits mailing list