本文整理汇总了Java中org.jfree.chart.axis.TickUnits类的典型用法代码示例。如果您正苦于以下问题:Java TickUnits类的具体用法?Java TickUnits怎么用?Java TickUnits使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TickUnits类属于org.jfree.chart.axis包,在下文中一共展示了TickUnits类的16个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: setRange
import org.jfree.chart.axis.TickUnits; //导入依赖的package包/类
private void setRange( int index ) {
ZoomSpec spec = _specs[ index ];
Range range = spec.getRange();
double tickSpacing = spec.getTickSpacing();
String tickPattern = spec.getTickPattern();
TickUnits tickUnits = new TickUnits();
tickUnits.add( new NumberTickUnit( tickSpacing, new DecimalFormat( tickPattern ) ) );
Iterator i = _plots.iterator();
while ( i.hasNext() ) {
XYPlot plot = (XYPlot) i.next();
if ( _orientation == HORIZONTAL ) {
plot.getDomainAxis().setRange( range );
plot.getDomainAxis().setStandardTickUnits( tickUnits );
}
else {
plot.getRangeAxis().setRange( range );
plot.getRangeAxis().setStandardTickUnits( tickUnits );
}
}
_zoomInButton.setEnabled( index > 0 );
_zoomOutButton.setEnabled( index < _specs.length - 1 );
}
开发者ID:mleoking,项目名称:PhET,代码行数:26,代码来源:ZoomControl.java
示例2: updateAxis
import org.jfree.chart.axis.TickUnits; //导入依赖的package包/类
private void updateAxis() {
// Range
AxisSpec axisSpec = _zoomSpec.getAxisSpec( _zoomIndex );
Range range = axisSpec.getRange();
// Ticks
double tickSpacing = axisSpec.getTickSpacing();
DecimalFormat tickFormat = axisSpec.getTickFormat();
TickUnits tickUnits = new TickUnits();
tickUnits.add( new NumberTickUnit( tickSpacing, tickFormat ) );
// Adjust the proper axis in each plot
Iterator i = _plots.iterator();
while ( i.hasNext() ) {
XYPlot plot = (XYPlot) i.next();
if ( _orientation == HORIZONTAL ) {
plot.getDomainAxis().setRange( range );
plot.getDomainAxis().setStandardTickUnits( tickUnits );
}
else {
plot.getRangeAxis().setRange( range );
plot.getRangeAxis().setStandardTickUnits( tickUnits );
}
}
}
开发者ID:mleoking,项目名称:PhET,代码行数:27,代码来源:ZoomControl.java
示例3: createWordedTimeTickUnits
import org.jfree.chart.axis.TickUnits; //导入依赖的package包/类
/**
* Returns a collection of tick units for integer values.
*/
public static TickUnitSource createWordedTimeTickUnits() {
final TickUnits units = new TickUnits();
units.add(new WordedTimeTickUnit(1));
units.add(new WordedTimeTickUnit(2));
units.add(new WordedTimeTickUnit(5));
units.add(new WordedTimeTickUnit(10));
units.add(new WordedTimeTickUnit(20));
units.add(new WordedTimeTickUnit(50));
units.add(new WordedTimeTickUnit(100));
units.add(new WordedTimeTickUnit(200));
units.add(new WordedTimeTickUnit(500));
units.add(new WordedTimeTickUnit(1000));
units.add(new WordedTimeTickUnit(2000));
units.add(new WordedTimeTickUnit(5000));
units.add(new WordedTimeTickUnit(10000));
units.add(new WordedTimeTickUnit(20000));
units.add(new WordedTimeTickUnit(50000));
units.add(new WordedTimeTickUnit(100000));
units.add(new WordedTimeTickUnit(200000));
units.add(new WordedTimeTickUnit(500000));
units.add(new WordedTimeTickUnit(1000000));
units.add(new WordedTimeTickUnit(2000000));
units.add(new WordedTimeTickUnit(5000000));
units.add(new WordedTimeTickUnit(10000000));
units.add(new WordedTimeTickUnit(20000000));
units.add(new WordedTimeTickUnit(50000000));
units.add(new WordedTimeTickUnit(100000000));
units.add(new WordedTimeTickUnit(200000000));
units.add(new WordedTimeTickUnit(500000000));
units.add(new WordedTimeTickUnit(1000000000));
units.add(new WordedTimeTickUnit(2000000000));
units.add(new WordedTimeTickUnit(5000000000.0));
units.add(new WordedTimeTickUnit(10000000000.0));
return units;
}
开发者ID:parabuild-ci,项目名称:parabuild-ci,代码行数:40,代码来源:StatisticsUtils.java
示例4: PositionAxis
import org.jfree.chart.axis.TickUnits; //导入依赖的package包/类
public PositionAxis() {
String label = QTResources.getString( "axis.position" ) + " (" + QTResources.getString( "units.position" ) + ")";
setLabel( label );
setLabelFont( QTConstants.AXIS_LABEL_FONT );
setRange( QTConstants.POSITION_RANGE );
TickUnits xUnits = (TickUnits) NumberAxis.createIntegerTickUnits();
setStandardTickUnits( xUnits );
}
开发者ID:mleoking,项目名称:PhET,代码行数:9,代码来源:PositionAxis.java
示例5: TPDomainAxis
import org.jfree.chart.axis.TickUnits; //导入依赖的package包/类
public TPDomainAxis() {
super( "titrant volume (mL)" );
setRange( TPConstants.TITRANT_VOLUME_RANGE.getMin(), TPConstants.TITRANT_VOLUME_RANGE.getMax() );
// ticks every 5 units
TickUnits tickUnits = new TickUnits();
tickUnits.add( new NumberTickUnit( 5, new DecimalFormat( "0" ) ) );
setStandardTickUnits( tickUnits );
setAutoTickUnitSelection( true );
}
开发者ID:mleoking,项目名称:PhET,代码行数:10,代码来源:TPChart.java
示例6: TPRangeAxis
import org.jfree.chart.axis.TickUnits; //导入依赖的package包/类
public TPRangeAxis() {
super( "pH" );
setRange( TPConstants.PH_RANGE.getMin(), TPConstants.PH_RANGE.getMax() );
// ticks every 1 unit
TickUnits tickUnits = new TickUnits();
tickUnits.add( new NumberTickUnit( 1, new DecimalFormat( "0" ) ) );
setStandardTickUnits( tickUnits );
setAutoTickUnitSelection( true );
}
开发者ID:mleoking,项目名称:PhET,代码行数:10,代码来源:TPChart.java
示例7: BSPositionAxis
import org.jfree.chart.axis.TickUnits; //导入依赖的package包/类
public BSPositionAxis() {
setRange( BSConstants.POSITION_VIEW_RANGE );
String label = BSResources.getString( "axis.position" ) + " (" + BSResources.getString( "units.position" ) + ")";
setLabel( label );
setLabelFont( BSConstants.AXIS_LABEL_FONT );
setTickLabelFont( BSConstants.AXIS_TICK_LABEL_FONT );
// Tick units
TickUnits tickUnits = new TickUnits();
tickUnits.add( new NumberTickUnit( BSConstants.POSITION_TICK_SPACING, BSConstants.POSITION_TICK_FORMAT ) );
setStandardTickUnits( tickUnits );
setAutoTickUnitSelection( true );
}
开发者ID:mleoking,项目名称:PhET,代码行数:16,代码来源:BSPositionAxis.java
示例8: createPolarPlot
import org.jfree.chart.axis.TickUnits; //导入依赖的package包/类
/**
* Creates a sample chart.
*
* @param dataset the dataset.
*
* @return A sample chart.
*/
private JFreeChart createPolarPlot(final XYDataset dataset)
{
final JFreeChart chart = ChartFactory.createPolarChart(
"Satellite Locations",
dataset,
false, //lengend
true, // tooltips
false // url
);
final PolarPlot plot = (PolarPlot) chart.getPlot();
chart.setBackgroundPaint(new Color(220,220,220));
ChartTheme dark = StandardChartTheme.createDarknessTheme();
dark.apply(chart);
plot.setOutlinePaint(Color.BLACK);
//final DefaultPolarItemRenderer renderer = (DefaultPolarItemRenderer) plot.getRenderer();
// set renderer - using my custom one
SctterPlotItemGPSRenderer rend = new SctterPlotItemGPSRenderer();
plot.setRenderer(rend);
// set horizon = 0-90
ValueAxis axis = plot.getAxis();
axis.setRange(0.0,90.0);
// set tick spacing
//axis.getRange().
//axis.setAutoTickUnitSelection(false);
//axis.setAutoRangeMinimumSize(3);
TickUnits tu = new TickUnits();
tu.add( new NumberTickUnit(15));
axis.setStandardTickUnits( tu );
return chart;
}
开发者ID:FracturedPlane,项目名称:GpsdInspector,代码行数:45,代码来源:GpsInspector.java
示例9: testEquals
import org.jfree.chart.axis.TickUnits; //导入依赖的package包/类
/**
* Confirm that the equals method can distinguish all the required fields.
*/
public void testEquals() {
TickUnits t1 = (TickUnits) NumberAxis.createIntegerTickUnits();
TickUnits t2 = (TickUnits) NumberAxis.createIntegerTickUnits();
assertTrue(t1.equals(t2));
assertTrue(t2.equals(t1));
}
开发者ID:SpoonLabs,项目名称:astor,代码行数:10,代码来源:TickUnitsTests.java
示例10: createChart
import org.jfree.chart.axis.TickUnits; //导入依赖的package包/类
private JFreeChart createChart(XYSeriesCollection dataSet, String chartTitle) {
JFreeChart chart = ChartFactory.createXYLineChart(
chartTitle,
"Time slice number",
"Classification",
dataSet,
PlotOrientation.VERTICAL,
true,
true,
false
);
XYPlot plot = chart.getXYPlot();
NumberAxis range = (NumberAxis) plot.getRangeAxis();
range.setRange(0, 1.1);
TickUnits units = new TickUnits();
units.add(new NumberTickUnit(0));
units.add(new NumberTickUnit(0.5));
units.add(new NumberTickUnit(1));
range.setStandardTickUnits(units);
range.setNumberFormatOverride(new DecimalFormat() {
public StringBuffer format(double number, StringBuffer toAppendTo, FieldPosition pos) {
if (number == 1)
return toAppendTo.append("badfs");
else if (number == 0.5)
return toAppendTo.append("badma");
else
return toAppendTo.append("good");
}
});
return chart;
}
开发者ID:sunimalr,项目名称:vimarsha,代码行数:36,代码来源:TimeSlicedClassiferForm.java
示例11: createChart
import org.jfree.chart.axis.TickUnits; //导入依赖的package包/类
private JFreeChart createChart(final XYDataset data,String title) {
final JFreeChart chart = ChartFactory.createScatterPlot(
title,
"X",
"Y",
data,
PlotOrientation.VERTICAL,
false,
true,
false
);
final XYPlot plot = chart.getXYPlot();
//plot.getRenderer().setToolTipGenerator(StandardXYToolTipGenerator.getTimeSeriesInstance());
final ValueAxis domainAxis = new NumberAxis("Time");
domainAxis.setUpperMargin(0.50);
domainAxis.setRange(0, 24);
TickUnits units = new TickUnits();
units.add(new NumberTickUnit(1));
domainAxis.setStandardTickUnits(units);
plot.setDomainAxis(domainAxis);
final ValueAxis rangeAxis = plot.getRangeAxis();
rangeAxis.setUpperMargin(0.30);
rangeAxis.setLowerMargin(0.50);
rangeAxis.setStandardTickUnits(units);
return chart;
}
开发者ID:emilioserra,项目名称:UbikSim,代码行数:33,代码来源:Periodogram.java
示例12: createIntegerTickUnits
import org.jfree.chart.axis.TickUnits; //导入依赖的package包/类
public TickUnitSource createIntegerTickUnits(Locale locale)
{
DecimalFormatSymbols formatSymbols = DecimalFormatSymbols.getInstance(locale);
// copied from NumberAxis.createIntegerTickUnits() to preserve backward behaviour
TickUnits units = new TickUnits();
DecimalFormat df0 = new DecimalFormat("0", formatSymbols);
DecimalFormat df1 = new DecimalFormat("#,##0", formatSymbols);
units.add(new NumberTickUnit(1, df0));
units.add(new NumberTickUnit(2, df0));
units.add(new NumberTickUnit(5, df0));
units.add(new NumberTickUnit(10, df0));
units.add(new NumberTickUnit(20, df0));
units.add(new NumberTickUnit(50, df0));
units.add(new NumberTickUnit(100, df0));
units.add(new NumberTickUnit(200, df0));
units.add(new NumberTickUnit(500, df0));
units.add(new NumberTickUnit(1000, df1));
units.add(new NumberTickUnit(2000, df1));
units.add(new NumberTickUnit(5000, df1));
units.add(new NumberTickUnit(10000, df1));
units.add(new NumberTickUnit(20000, df1));
units.add(new NumberTickUnit(50000, df1));
units.add(new NumberTickUnit(100000, df1));
units.add(new NumberTickUnit(200000, df1));
units.add(new NumberTickUnit(500000, df1));
units.add(new NumberTickUnit(1000000, df1));
units.add(new NumberTickUnit(2000000, df1));
units.add(new NumberTickUnit(5000000, df1));
units.add(new NumberTickUnit(10000000, df1));
units.add(new NumberTickUnit(20000000, df1));
units.add(new NumberTickUnit(50000000, df1));
units.add(new NumberTickUnit(100000000, df1));
units.add(new NumberTickUnit(200000000, df1));
units.add(new NumberTickUnit(500000000, df1));
units.add(new NumberTickUnit(1000000000, df1));
units.add(new NumberTickUnit(2000000000, df1));
units.add(new NumberTickUnit(5000000000.0, df1));
units.add(new NumberTickUnit(10000000000.0, df1));
// adding further values by default because 1E10 is not enough for some people
// using getNumberInstance because that's what NumberAxis.createIntegerTickUnits does
units.add(new NumberTickUnit(20000000000L, df1));
units.add(new NumberTickUnit(50000000000L, df1));
units.add(new NumberTickUnit(100000000000L, df1));
units.add(new NumberTickUnit(200000000000L, df1));
units.add(new NumberTickUnit(500000000000L, df1));
units.add(new NumberTickUnit(1000000000000L, df1));
units.add(new NumberTickUnit(2000000000000L, df1));
units.add(new NumberTickUnit(5000000000000L, df1));
units.add(new NumberTickUnit(10000000000000L, df1));
units.add(new NumberTickUnit(20000000000000L, df1));
units.add(new NumberTickUnit(50000000000000L, df1));
units.add(new NumberTickUnit(100000000000000L, df1));
units.add(new NumberTickUnit(200000000000000L, df1));
units.add(new NumberTickUnit(500000000000000L, df1));
units.add(new NumberTickUnit(1000000000000000L, df1));
units.add(new NumberTickUnit(2000000000000000L, df1));
units.add(new NumberTickUnit(5000000000000000L, df1));
units.add(new NumberTickUnit(10000000000000000L, df1));
units.add(new NumberTickUnit(20000000000000000L, df1));
units.add(new NumberTickUnit(50000000000000000L, df1));
units.add(new NumberTickUnit(100000000000000000L, df1));
units.add(new NumberTickUnit(200000000000000000L, df1));
units.add(new NumberTickUnit(500000000000000000L, df1));
units.add(new NumberTickUnit(1000000000000000000L, df1));
units.add(new NumberTickUnit(2000000000000000000L, df1));
units.add(new NumberTickUnit(5000000000000000000L, df1));
return units;
}
开发者ID:TIBCOSoftware,项目名称:jasperreports,代码行数:72,代码来源:ChartUtil.java
示例13: SchedulePlanningPanel
import org.jfree.chart.axis.TickUnits; //导入依赖的package包/类
public SchedulePlanningPanel() {
setLayout(new BorderLayout());
// setup the stacked bar chart
dataset = new DefaultCategoryDataset();
final JFreeChart chart = ChartFactory.createStackedBarChart(
null, // chart title
Utils.getRB().getString("CardTableModel.stats.weekSchedule"), // domain axis label
// "# cards", // range axis label
null, // range axis label
dataset, // data
PlotOrientation.VERTICAL, // the plot orientation
false, // legend
true, // tooltips
false // urls
);
StackedBarRenderer renderer = new StackedBarRenderer();
renderer.setGradientPaintTransformer(new StandardGradientPaintTransformer(GradientPaintTransformType.HORIZONTAL));
//green
renderer.setItemMargin(0.0);
Paint greenPaint = new GradientPaint(0.0f, 0.0f, new Color(0x22, 0xFF, 0x22), 0.0f, 0.0f, new Color(0x88, 0xFF, 0x88));
renderer.setSeriesPaint(1, greenPaint);
renderer.setSeriesToolTipGenerator(1, new StandardCategoryToolTipGenerator());
//blue
Paint bluePaint = new GradientPaint(0.0f, 0.0f, new Color(0x22, 0x22, 0xFF), 0.0f, 0.0f, new Color(0x88, 0x88, 0xFF));
renderer.setSeriesPaint(0, bluePaint);
renderer.setSeriesToolTipGenerator(0, new StandardCategoryToolTipGenerator());
// Paint p2 = new GradientPaint(0.0f, 0.0f, new Color(0xFF, 0x22, 0x22), 0.0f, 0.0f, new Color(0xFF, 0x88, 0x88));
// renderer.setSeriesPaint(1, p2);
// renderer.setSeriesToolTipGenerator(1, new StandardCategoryToolTipGenerator());
//
// Paint p3 = new GradientPaint(0.0f, 0.0f, new Color(0x22, 0xFF, 0x22), 0.0f, 0.0f, new Color(0x88, 0xFF, 0x88));
// renderer.setSeriesPaint(2, p3);
// renderer.setSeriesToolTipGenerator(2, new StandardCategoryToolTipGenerator());
CategoryPlot plot = (CategoryPlot) chart.getPlot();
plot.setRenderer(renderer);
valueAxis = plot.getRangeAxis();
TickUnits units = (TickUnits) NumberAxis.createIntegerTickUnits();
valueAxis.setStandardTickUnits(units);
ChartPanel chartPanel = new ChartPanel(chart);
chartPanel.setPopupMenu(null);
chartPanel.setDomainZoomable(false);
chartPanel.setRangeZoomable(false);
add(chartPanel, BorderLayout.CENTER);
rebuildPanel(new HashSet<CardFile>());
}
开发者ID:holgerbrandl,项目名称:opencards,代码行数:57,代码来源:SchedulePlanningPanel.java
示例14: LTMStateGraphPanel
import org.jfree.chart.axis.TickUnits; //导入依赖的package包/类
public LTMStateGraphPanel() {
setLayout(new BorderLayout());
// setup the stacked bar chart
dataset = new DefaultCategoryDataset();
final JFreeChart chart = ChartFactory.createStackedBarChart(
null, // chart title
Utils.getRB().getString("CardTableModel.stats.learnsuccess"), // domain axis label
// "# cards", // range axis label
null, // range axis label
dataset, // data
PlotOrientation.VERTICAL, // the plot orientation
false, // legend
true, // tooltips
false // urls
);
StackedBarRenderer renderer = new StackedBarRenderer();
renderer.setGradientPaintTransformer(new StandardGradientPaintTransformer(GradientPaintTransformType.HORIZONTAL));
renderer.setItemMargin(0.0);
Paint bluePaint = new GradientPaint(0.0f, 0.0f, new Color(0x22, 0x22, 0xFF), 0.0f, 0.0f, new Color(0x88, 0x88, 0xFF));
renderer.setSeriesPaint(0, bluePaint);
renderer.setSeriesToolTipGenerator(0, new StandardCategoryToolTipGenerator());
// Paint p2 = new GradientPaint(0.0f, 0.0f, new Color(0xFF, 0x22, 0x22), 0.0f, 0.0f, new Color(0xFF, 0x88, 0x88));
// renderer.setSeriesPaint(1, p2);
// renderer.setSeriesToolTipGenerator(1, new StandardCategoryToolTipGenerator());
//
// Paint p3 = new GradientPaint(0.0f, 0.0f, new Color(0x22, 0xFF, 0x22), 0.0f, 0.0f, new Color(0x88, 0xFF, 0x88));
// renderer.setSeriesPaint(2, p3);
// renderer.setSeriesToolTipGenerator(2, new StandardCategoryToolTipGenerator());
CategoryPlot plot = (CategoryPlot) chart.getPlot();
plot.setRenderer(renderer);
valueAxis = plot.getRangeAxis();
TickUnits units = (TickUnits) NumberAxis.createIntegerTickUnits();
valueAxis.setStandardTickUnits(units);
ChartPanel chartPanel = new ChartPanel(chart);
chartPanel.setPopupMenu(null);
chartPanel.setDomainZoomable(false);
chartPanel.setRangeZoomable(false);
add(chartPanel, BorderLayout.CENTER);
rebuildPanel(new HashSet<CardFile>());
learnedPerfectly = Utils.getRB().getString("CardTableModel.stats.perfect");
learnedNotYet = Utils.getRB().getString("CardTableModel.stats.notatall");
learnedNaJa = Utils.getRB().getString("CardTableModel.stats.well");
}
开发者ID:holgerbrandl,项目名称:opencards,代码行数:52,代码来源:LTMStateGraphPanel.java
示例15: createChart
import org.jfree.chart.axis.TickUnits; //导入依赖的package包/类
/**
* Returns the chart.
*
* @param dataset the dataset.
*
* @return The chart.
*/
protected JFreeChart createChart(CategoryDataset dataset) {
JFreeChart chart = ChartFactory.createWaterfallChart(
chartTitle,
domainLabel,
rangeLabel,
dataset,
PlotOrientation.VERTICAL,
!legendPanelOn,
true,
false
);
chart.setBackgroundPaint(Color.white);
CategoryPlot plot = chart.getCategoryPlot();
plot.setBackgroundPaint(Color.lightGray);
plot.setRangeGridlinePaint(Color.white);
plot.setRangeGridlinesVisible(true);
plot.setAxisOffset(new RectangleInsets(5.0, 5.0, 5.0, 5.0));
ValueAxis rangeAxis = plot.getRangeAxis();
// create a custom tick unit collection...
DecimalFormat formatter = new DecimalFormat("##,###");
formatter.setNegativePrefix("(");
formatter.setNegativeSuffix(")");
TickUnits standardUnits = new TickUnits();
standardUnits.add(new NumberTickUnit(5, formatter));
standardUnits.add(new NumberTickUnit(10, formatter));
standardUnits.add(new NumberTickUnit(20, formatter));
standardUnits.add(new NumberTickUnit(50, formatter));
standardUnits.add(new NumberTickUnit(100, formatter));
standardUnits.add(new NumberTickUnit(200, formatter));
standardUnits.add(new NumberTickUnit(500, formatter));
standardUnits.add(new NumberTickUnit(1000, formatter));
standardUnits.add(new NumberTickUnit(2000, formatter));
standardUnits.add(new NumberTickUnit(5000, formatter));
rangeAxis.setStandardTickUnits(standardUnits);
BarRenderer renderer = (BarRenderer) plot.getRenderer();
renderer.setDrawBarOutline(false);
renderer.setLegendItemLabelGenerator(new SOCRCategorySeriesLabelGenerator());
DecimalFormat labelFormatter = new DecimalFormat("$##,###.00");
labelFormatter.setNegativePrefix("(");
labelFormatter.setNegativeSuffix(")");
renderer.setBaseItemLabelGenerator(
new StandardCategoryItemLabelGenerator("{2}", labelFormatter)
);
renderer.setBaseItemLabelsVisible(true);
setCategorySummary(dataset);
return chart;
}
开发者ID:SOCR,项目名称:HTML5_WebSite,代码行数:62,代码来源:WaterfallChartDemo1.java
示例16: createProgressChart
import org.jfree.chart.axis.TickUnits; //导入依赖的package包/类
private JFreeChart createProgressChart(Map<String, Integer> chartValues, int aMaxValue,
boolean aIsPercentage)
{
// fill dataset
DefaultCategoryDataset dataset = new DefaultCategoryDataset();
if (aMaxValue > 0) {
for (String chartValue : chartValues.keySet()) {
dataset.setValue(chartValues.get(chartValue), "Completion", chartValue);
}
}
// create chart
JFreeChart chart = ChartFactory.createBarChart(null, null, null, dataset,
PlotOrientation.HORIZONTAL, false, false, false);
CategoryPlot plot = chart.getCategoryPlot();
plot.setOutlineVisible(false);
plot.setBackgroundPaint(null);
plot.setNoDataMessage("No data");
plot.setInsets(new RectangleInsets(UnitType.ABSOLUTE, 0, 20, 0, 20));
if (aMaxValue > 0) {
plot.getRangeAxis().setRange(0.0, aMaxValue);
((NumberAxis) plot.getRangeAxis()).setNumberFormatOverride(new DecimalFormat("0"));
// For documents less than 10, avoid repeating the number of documents such
// as 0 0 1 1 1 - NumberTickUnit automatically determines the range
if (!aIsPercentage && aMaxValue <= 10) {
TickUnits standardUnits = new TickUnits();
NumberAxis tick = new NumberAxis();
tick.setTickUnit(new NumberTickUnit(1));
standardUnits.add(tick.getTickUnit());
plot.getRangeAxis().setStandardTickUnits(standardUnits);
}
}
else {
plot.getRangeAxis().setVisible(false);
plot.getDomainAxis().setVisible(false);
}
BarRenderer renderer = new BarRenderer();
renderer.setBarPainter(new StandardBarPainter());
renderer.setShadowVisible(false);
// renderer.setGradientPaintTransformer(new
// StandardGradientPaintTransformer(
// GradientPaintTransformType.HORIZONTAL));
renderer.setSeriesPaint(0, Color.BLUE);
chart.getCategoryPlot().setRenderer(renderer);
return chart;
}
开发者ID:webanno,项目名称:webanno,代码行数:50,代码来源:MonitoringPage.java
注:本文中的org.jfree.chart.axis.TickUnits类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论