本文整理汇总了Java中org.jfree.chart.plot.MeterPlot.setTickPaint方法的典型用法代码示例。如果您正苦于以下问题:Java MeterPlot.setTickPaint方法的具体用法?Java MeterPlot.setTickPaint怎么用?Java MeterPlot.setTickPaint使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jfree.chart.plot.MeterPlot
的用法示例。
在下文中一共展示了MeterPlot.setTickPaint方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createMeterPlot
import org.jfree.chart.plot.MeterPlot; //导入方法依赖的package包/类
/** Creates a meter plot and sets color values */
private MeterPlot createMeterPlot() {
MeterPlot plot = new MeterPlot(new DefaultValueDataset(value));
plot.setUnits(unit);
plot.setDialShape(DialShape.CHORD);
plot.setDialBackgroundPaint(Color.WHITE);
plot.setRange(new Range(0, redThreshold));
plot.setDialOutlinePaint(Color.GRAY);
plot.setNeedlePaint(Color.BLACK);
plot.setTickLabelsVisible(true);
plot.setTickLabelPaint(Color.BLACK);
plot.setTickPaint(Color.GRAY);
plot.setTickLabelFormat(NumberFormat.getNumberInstance());
plot.setTickSize(10);
plot.setValuePaint(Color.BLACK);
return plot;
}
示例2: createDialChart
import org.jfree.chart.plot.MeterPlot; //导入方法依赖的package包/类
private JFreeChart createDialChart(ReportChart reportChart,
ChartValue[] values, boolean displayInline)
{
DefaultValueDataset dataset = createDefaultValueDataset(values);
MeterPlot plot = new MeterPlot(dataset);
plot.setRange(new Range(0, 60));
plot.addInterval(new MeterInterval("Normal", new Range(0.0, 35.0),
Color.lightGray, new BasicStroke(2.0f), new Color(0, 255, 0, 64)));
plot.addInterval(new MeterInterval("Warning", new Range(35.0, 50.0),
Color.lightGray, new BasicStroke(2.0f), new Color(255, 255, 0, 64)));
plot.addInterval(new MeterInterval("Critical", new Range(50.0, 60.0),
Color.lightGray, new BasicStroke(2.0f), new Color(255, 0, 0, 128)));
plot.setNeedlePaint(Color.darkGray);
plot.setDialBackgroundPaint(Color.white);
plot.setDialOutlinePaint(Color.gray);
plot.setDialShape(DialShape.CHORD);
plot.setMeterAngle(260);
plot.setTickLabelsVisible(true);
plot.setTickLabelFont(new Font("Dialog", Font.BOLD, 10));
plot.setTickLabelPaint(Color.darkGray);
plot.setTickSize(5.0);
plot.setTickPaint(Color.lightGray);
plot.setValuePaint(Color.black);
plot.setValueFont(new Font("Dialog", Font.BOLD, 14));
JFreeChart chart = new JFreeChart(reportChart.getTitle(),
JFreeChart.DEFAULT_TITLE_FONT, plot, reportChart.isShowLegend());
return chart;
}
示例3: getGaugeChart
import org.jfree.chart.plot.MeterPlot; //导入方法依赖的package包/类
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 * 10;
double end = start + 10;
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;
}
示例4: createDialChart
import org.jfree.chart.plot.MeterPlot; //导入方法依赖的package包/类
private JFreeChart createDialChart(ReportChart reportChart,
ChartValue[] values, boolean displayInline)
{
DefaultValueDataset dataset = createDefaultValueDataset(values);
MeterPlot plot = new MeterPlot(dataset);
plot.setRange(new Range(0, 60));
plot.addInterval(new MeterInterval("Normal", new Range(0.0, 35.0),
Color.lightGray, new BasicStroke(2.0f), new Color(0, 255, 0, 64)));
plot.addInterval(new MeterInterval("Warning", new Range(35.0, 50.0),
Color.lightGray, new BasicStroke(2.0f), new Color(255, 255, 0, 64)));
plot.addInterval(new MeterInterval("Critical", new Range(50.0, 60.0),
Color.lightGray, new BasicStroke(2.0f), new Color(255, 0, 0, 128)));
plot.setNeedlePaint(Color.darkGray);
plot.setDialBackgroundPaint(Color.white);
plot.setDialOutlinePaint(Color.gray);
plot.setDialShape(DialShape.CHORD);
plot.setMeterAngle(260);
plot.setTickLabelsVisible(true);
plot.setTickLabelFont(new Font("Dialog", Font.BOLD, 10));
plot.setTickLabelPaint(Color.darkGray);
plot.setTickSize(5.0);
plot.setTickPaint(Color.lightGray);
plot.setValuePaint(Color.black);
plot.setValueFont(new Font("Dialog", Font.BOLD, 14));
JFreeChart chart = new JFreeChart(reportChart.getTitle(),
JFreeChart.DEFAULT_TITLE_FONT, plot, reportChart.isShowLegend());
return chart;
}