/** * Applies the attributes of this theme to a {@link MeterPlot}. * * @param plot the plot ({@code null} not permitted). */ protected void applyToMeterPlot(MeterPlot plot) { plot.setDialBackgroundPaint(this.plotBackgroundPaint); plot.setValueFont(this.largeFont); plot.setValuePaint(this.axisLabelPaint); plot.setDialOutlinePaint(this.plotOutlinePaint); plot.setNeedlePaint(this.thermometerPaint); plot.setTickLabelFont(this.regularFont); plot.setTickLabelPaint(this.tickLabelPaint); }
/** * Applies the attributes of this theme to a {@link MeterPlot}. * * @param plot the plot (<code>null</code> not permitted). */ protected void applyToMeterPlot(MeterPlot plot) { plot.setDialBackgroundPaint(this.plotBackgroundPaint); plot.setValueFont(this.largeFont); plot.setValuePaint(this.axisLabelPaint); plot.setDialOutlinePaint(this.plotOutlinePaint); plot.setNeedlePaint(this.thermometerPaint); plot.setTickLabelFont(this.regularFont); plot.setTickLabelPaint(this.tickLabelPaint); }
private JFreeChart getGaugeChart( BaseChart chart, ValueDataset dataSet ) { MeterPlot meterPlot = new MeterPlot( dataSet ); meterPlot.setUnits( "" ); meterPlot.setRange( new Range( 0.0d, 100d ) ); for ( int i = 0; i < 10; i++ ) { double start = i * 10d; double end = start + 10d; String label = String.valueOf( start ); meterPlot.addInterval( new MeterInterval( label, new Range( start, end ), COLOR_LIGHT_GRAY, null, COLOR_LIGHT_GRAY ) ); } meterPlot.setMeterAngle(180); meterPlot.setDialBackgroundPaint( COLOR_LIGHT_GRAY ); meterPlot.setDialShape( DialShape.CHORD ); meterPlot.setNeedlePaint( COLORS[0] ); meterPlot.setTickLabelsVisible( true ); meterPlot.setTickLabelFont( LABEL_FONT ); meterPlot.setTickLabelPaint( Color.BLACK ); meterPlot.setTickPaint( COLOR_LIGHTER_GRAY ); meterPlot.setValueFont( TITLE_FONT ); meterPlot.setValuePaint( Color.BLACK ); JFreeChart meterChart = new JFreeChart( chart.getName(), meterPlot ); setBasicConfig( meterChart, chart ); meterChart.removeLegend(); return meterChart; }
chartPlot.setNeedlePaint(color);
meter.setNeedlePaint( widget.getNeedlePaint() ); meter.setDialShape( widget.getDialShape() ); meter.setDialBackgroundPaint( widget.getPlotBackgroundPaint() );