thangalin Posted March 24, 2010 Share Posted March 24, 2010 Hi,/** * Draws a (smooth) Bezier line between consecutive data points on a chart. * This is especially useful for Time Series plots. */public class BezierLineCustomizer extends JRAbstractChartCustomizer { public BezierLineCustomizer() { } /** * Initializes the chart customizer. * @param chartFiller Ignored. * @param chart Contains the */ @Override public void init( JRBaseFiller chartFiller, JRFillChart chart ) { super.init( chartFiller, chart ); JRTimeSeriesDataset dataset = (JRTimeSeriesDataset)chart.getDataset(); dataset.setTimePeriod( org.jfree.data.time.Day.class ); JRFillVariable trendAverage = chartFiller.getVariable( RunningAverageIncrementer.IREPORT_VARIABLE ); JRIncrementer incrementer = trendAverage.getIncrementer(); if( incrementer instanceof RunningAverageIncrementer ) { ((RunningAverageIncrementer)incrementer).setSetSize( 30 ); } } // ... etc. ... The bold line in the code above does not compile.Is there another way to get the JRFillVariable instance from a subclass of JRAbstractChartCustomizer?Thanks! Link to comment Share on other sites More sharing options...
thangalin Posted March 24, 2010 Author Share Posted March 24, 2010 Another way to get the incrementer: private JRIncrementer getIncrementer( JRBaseFiller chartFiller ) { JRVariable[] variables = chartFiller.getMainDataset().getVariables(); JRIncrementer result = null; for( JRVariable var : variables ) { if( var instanceof JRFillVariable ) { result = ((JRFillVariable)var).getIncrementer(); break; } } return result; }Post Edited by thangalin at 03/24/2010 19:30 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now