本文整理汇总了Java中org.jfree.chart.labels.StandardXYItemLabelGenerator类的典型用法代码示例。如果您正苦于以下问题:Java StandardXYItemLabelGenerator类的具体用法?Java StandardXYItemLabelGenerator怎么用?Java StandardXYItemLabelGenerator使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
StandardXYItemLabelGenerator类属于org.jfree.chart.labels包,在下文中一共展示了StandardXYItemLabelGenerator类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setTimeSeriesBarRender
import org.jfree.chart.labels.StandardXYItemLabelGenerator; //导入依赖的package包/类
public static void setTimeSeriesBarRender(Plot plot, boolean isShowDataLabels) {
XYPlot xyplot = (XYPlot) plot;
xyplot.setNoDataMessage(NO_DATA_MSG);
XYBarRenderer xyRenderer = new XYBarRenderer(0.1D);
xyRenderer.setBaseItemLabelGenerator(new StandardXYItemLabelGenerator());
if (isShowDataLabels) {
xyRenderer.setBaseItemLabelsVisible(true);
xyRenderer.setBaseItemLabelGenerator(new StandardXYItemLabelGenerator());
}
StandardXYToolTipGenerator xyTooltipGenerator = new StandardXYToolTipGenerator("{1}:{2}", new SimpleDateFormat("yyyy-MM-dd"), new DecimalFormat("0"));
xyRenderer.setBaseToolTipGenerator(xyTooltipGenerator);
setXY_XAixs(xyplot);
setXY_YAixs(xyplot);
}
示例2: setTimeSeriesRender
import org.jfree.chart.labels.StandardXYItemLabelGenerator; //导入依赖的package包/类
public static void setTimeSeriesRender(Plot plot, boolean isShowData, boolean isShapesVisible) {
XYPlot xyplot = (XYPlot) plot;
xyplot.setNoDataMessage(NO_DATA_MSG);
xyplot.setInsets(new RectangleInsets(10, 10, 5, 10));
XYLineAndShapeRenderer xyRenderer = (XYLineAndShapeRenderer) xyplot.getRenderer();
xyRenderer.setBaseItemLabelGenerator(new StandardXYItemLabelGenerator());
xyRenderer.setBaseShapesVisible(false);
if (isShowData) {
xyRenderer.setBaseItemLabelsVisible(true);
xyRenderer.setBaseItemLabelGenerator(new StandardXYItemLabelGenerator());
xyRenderer.setBasePositiveItemLabelPosition(new ItemLabelPosition(ItemLabelAnchor.OUTSIDE1, TextAnchor.BOTTOM_CENTER));
}
xyRenderer.setBaseShapesVisible(isShapesVisible);
DateAxis domainAxis = (DateAxis) xyplot.getDomainAxis();
domainAxis.setAutoTickUnitSelection(false);
DateTickUnit dateTickUnit = new DateTickUnit(DateTickUnitType.YEAR, 1, new SimpleDateFormat("yyyy-MM"));
domainAxis.setTickUnit(dateTickUnit);
StandardXYToolTipGenerator xyTooltipGenerator = new StandardXYToolTipGenerator("{1}:{2}", new SimpleDateFormat("yyyy-MM-dd"), new DecimalFormat("0"));
xyRenderer.setBaseToolTipGenerator(xyTooltipGenerator);
setXY_XAixs(xyplot);
setXY_YAixs(xyplot);
}
示例3: testCloning
import org.jfree.chart.labels.StandardXYItemLabelGenerator; //导入依赖的package包/类
/**
* Confirm that cloning works.
*/
@Test
public void testCloning() throws CloneNotSupportedException {
YIntervalRenderer r1 = new YIntervalRenderer();
YIntervalRenderer r2 = (YIntervalRenderer) r1.clone();
assertTrue(r1 != r2);
assertTrue(r1.getClass() == r2.getClass());
assertTrue(r1.equals(r2));
// check independence
r1.setSeriesItemLabelGenerator(0, new StandardXYItemLabelGenerator());
assertFalse(r1.equals(r2));
r2.setSeriesItemLabelGenerator(0, new StandardXYItemLabelGenerator());
assertTrue(r1.equals(r2));
r1.setSeriesToolTipGenerator(0, new StandardXYToolTipGenerator());
assertFalse(r1.equals(r2));
r2.setSeriesToolTipGenerator(0, new StandardXYToolTipGenerator());
assertTrue(r1.equals(r2));
r1.addAnnotation(new XYTextAnnotation("ABC", 1.0, 2.0),
Layer.FOREGROUND);
assertFalse(r1.equals(r2));
r2.addAnnotation(new XYTextAnnotation("ABC", 1.0, 2.0),
Layer.FOREGROUND);
assertTrue(r1.equals(r2));
r1.addAnnotation(new XYTextAnnotation("ABC", 1.0, 2.0),
Layer.BACKGROUND);
assertFalse(r1.equals(r2));
r2.addAnnotation(new XYTextAnnotation("ABC", 1.0, 2.0),
Layer.BACKGROUND);
assertTrue(r1.equals(r2));
}
示例4: testEquals_ObjectList
import org.jfree.chart.labels.StandardXYItemLabelGenerator; //导入依赖的package包/类
@Test
public void testEquals_ObjectList() {
XYBarRenderer r1 = new XYBarRenderer();
r1.setSeriesItemLabelGenerator(0, new StandardXYItemLabelGenerator());
XYBarRenderer r2 = new XYBarRenderer();
r2.setSeriesItemLabelGenerator(0, new StandardXYItemLabelGenerator());
assertEquals(r1, r2);
r2.setSeriesItemLabelGenerator(1, new StandardXYItemLabelGenerator("X"));
assertNotEquals(r1, r2);
}
示例5: equals
import org.jfree.chart.labels.StandardXYItemLabelGenerator; //导入依赖的package包/类
/**
* Tests this object for equality with an arbitrary object.
*
* @param obj the other object (<code>null</code> permitted).
*
* @return A boolean.
*/
public boolean equals(Object obj) {
if (obj == this) {
return true;
}
if (obj instanceof StandardXYItemLabelGenerator) {
return super.equals(obj);
}
return false;
}
示例6: testHashCode
import org.jfree.chart.labels.StandardXYItemLabelGenerator; //导入依赖的package包/类
/**
* Simple check that hashCode is implemented.
*/
public void testHashCode() {
StandardXYItemLabelGenerator g1
= new StandardXYItemLabelGenerator();
StandardXYItemLabelGenerator g2
= new StandardXYItemLabelGenerator();
assertTrue(g1.equals(g2));
assertTrue(g1.hashCode() == g2.hashCode());
}
示例7: testEquals
import org.jfree.chart.labels.StandardXYItemLabelGenerator; //导入依赖的package包/类
/**
* Check that the equals() method distinguishes all fields.
*/
public void testEquals() {
YIntervalRenderer r1 = new YIntervalRenderer();
YIntervalRenderer r2 = new YIntervalRenderer();
assertEquals(r1, r2);
// the following fields are inherited from the AbstractXYItemRenderer
r1.setItemLabelGenerator(new StandardXYItemLabelGenerator());
assertFalse(r1.equals(r2));
r2.setItemLabelGenerator(new StandardXYItemLabelGenerator());
assertTrue(r1.equals(r2));
r1.setSeriesItemLabelGenerator(0, new StandardXYItemLabelGenerator());
assertFalse(r1.equals(r2));
r2.setSeriesItemLabelGenerator(0, new StandardXYItemLabelGenerator());
assertTrue(r1.equals(r2));
r1.setBaseItemLabelGenerator(new StandardXYItemLabelGenerator());
assertFalse(r1.equals(r2));
r2.setBaseItemLabelGenerator(new StandardXYItemLabelGenerator());
assertTrue(r1.equals(r2));
r1.setToolTipGenerator(new StandardXYToolTipGenerator());
assertFalse(r1.equals(r2));
r2.setToolTipGenerator(new StandardXYToolTipGenerator());
assertTrue(r1.equals(r2));
r1.setSeriesToolTipGenerator(0, new StandardXYToolTipGenerator());
assertFalse(r1.equals(r2));
r2.setSeriesToolTipGenerator(0, new StandardXYToolTipGenerator());
assertTrue(r1.equals(r2));
r1.setBaseToolTipGenerator(new StandardXYToolTipGenerator());
assertFalse(r1.equals(r2));
r2.setBaseToolTipGenerator(new StandardXYToolTipGenerator());
assertTrue(r1.equals(r2));
r1.setURLGenerator(new StandardXYURLGenerator());
assertFalse(r1.equals(r2));
r2.setURLGenerator(new StandardXYURLGenerator());
assertTrue(r1.equals(r2));
r1.addAnnotation(new XYTextAnnotation("X", 1.0, 2.0), Layer.FOREGROUND);
assertFalse(r1.equals(r2));
r2.addAnnotation(new XYTextAnnotation("X", 1.0, 2.0), Layer.FOREGROUND);
assertTrue(r1.equals(r2));
r1.addAnnotation(new XYTextAnnotation("X", 1.0, 2.0), Layer.BACKGROUND);
assertFalse(r1.equals(r2));
r2.addAnnotation(new XYTextAnnotation("X", 1.0, 2.0), Layer.BACKGROUND);
assertTrue(r1.equals(r2));
r1.setDefaultEntityRadius(99);
assertFalse(r1.equals(r2));
r2.setDefaultEntityRadius(99);
assertTrue(r1.equals(r2));
r1.setLegendItemLabelGenerator(new StandardXYSeriesLabelGenerator(
"{0} {1}"));
assertFalse(r1.equals(r2));
r2.setLegendItemLabelGenerator(new StandardXYSeriesLabelGenerator(
"{0} {1}"));
assertTrue(r1.equals(r2));
r1.setLegendItemToolTipGenerator(new StandardXYSeriesLabelGenerator());
assertFalse(r1.equals(r2));
r2.setLegendItemToolTipGenerator(new StandardXYSeriesLabelGenerator());
assertTrue(r1.equals(r2));
r1.setLegendItemURLGenerator(new StandardXYSeriesLabelGenerator());
assertFalse(r1.equals(r2));
r2.setLegendItemURLGenerator(new StandardXYSeriesLabelGenerator());
assertTrue(r1.equals(r2));
}
示例8: testEquals
import org.jfree.chart.labels.StandardXYItemLabelGenerator; //导入依赖的package包/类
/**
* Check that the equals() method distinguishes all fields.
*/
@Test
public void testEquals() {
YIntervalRenderer r1 = new YIntervalRenderer();
YIntervalRenderer r2 = new YIntervalRenderer();
assertEquals(r1, r2);
// the following fields are inherited from the AbstractXYItemRenderer
r1.setSeriesItemLabelGenerator(0, new StandardXYItemLabelGenerator());
assertFalse(r1.equals(r2));
r2.setSeriesItemLabelGenerator(0, new StandardXYItemLabelGenerator());
assertTrue(r1.equals(r2));
r1.setDefaultItemLabelGenerator(new StandardXYItemLabelGenerator());
assertFalse(r1.equals(r2));
r2.setDefaultItemLabelGenerator(new StandardXYItemLabelGenerator());
assertTrue(r1.equals(r2));
r1.setSeriesToolTipGenerator(0, new StandardXYToolTipGenerator());
assertFalse(r1.equals(r2));
r2.setSeriesToolTipGenerator(0, new StandardXYToolTipGenerator());
assertTrue(r1.equals(r2));
r1.setDefaultToolTipGenerator(new StandardXYToolTipGenerator());
assertFalse(r1.equals(r2));
r2.setDefaultToolTipGenerator(new StandardXYToolTipGenerator());
assertTrue(r1.equals(r2));
r1.setURLGenerator(new StandardXYURLGenerator());
assertFalse(r1.equals(r2));
r2.setURLGenerator(new StandardXYURLGenerator());
assertTrue(r1.equals(r2));
r1.addAnnotation(new XYTextAnnotation("X", 1.0, 2.0), Layer.FOREGROUND);
assertFalse(r1.equals(r2));
r2.addAnnotation(new XYTextAnnotation("X", 1.0, 2.0), Layer.FOREGROUND);
assertTrue(r1.equals(r2));
r1.addAnnotation(new XYTextAnnotation("X", 1.0, 2.0), Layer.BACKGROUND);
assertFalse(r1.equals(r2));
r2.addAnnotation(new XYTextAnnotation("X", 1.0, 2.0), Layer.BACKGROUND);
assertTrue(r1.equals(r2));
r1.setDefaultEntityRadius(99);
assertFalse(r1.equals(r2));
r2.setDefaultEntityRadius(99);
assertTrue(r1.equals(r2));
r1.setLegendItemLabelGenerator(new StandardXYSeriesLabelGenerator(
"{0} {1}"));
assertFalse(r1.equals(r2));
r2.setLegendItemLabelGenerator(new StandardXYSeriesLabelGenerator(
"{0} {1}"));
assertTrue(r1.equals(r2));
r1.setLegendItemToolTipGenerator(new StandardXYSeriesLabelGenerator());
assertFalse(r1.equals(r2));
r2.setLegendItemToolTipGenerator(new StandardXYSeriesLabelGenerator());
assertTrue(r1.equals(r2));
r1.setLegendItemURLGenerator(new StandardXYSeriesLabelGenerator());
assertFalse(r1.equals(r2));
r2.setLegendItemURLGenerator(new StandardXYSeriesLabelGenerator());
assertTrue(r1.equals(r2));
r1.setAdditionalItemLabelGenerator(new IntervalXYItemLabelGenerator());
assertFalse(r1.equals(r2));
r2.setAdditionalItemLabelGenerator(new IntervalXYItemLabelGenerator());
assertTrue(r1.equals(r2));
}
示例9: testEquals
import org.jfree.chart.labels.StandardXYItemLabelGenerator; //导入依赖的package包/类
/**
* Check that the equals() method distinguishes all fields.
*/
public void testEquals() {
YIntervalRenderer r1 = new YIntervalRenderer();
YIntervalRenderer r2 = new YIntervalRenderer();
assertEquals(r1, r2);
// the following fields are inherited from the AbstractXYItemRenderer
r1.setSeriesItemLabelGenerator(0, new StandardXYItemLabelGenerator());
assertFalse(r1.equals(r2));
r2.setSeriesItemLabelGenerator(0, new StandardXYItemLabelGenerator());
assertTrue(r1.equals(r2));
r1.setBaseItemLabelGenerator(new StandardXYItemLabelGenerator());
assertFalse(r1.equals(r2));
r2.setBaseItemLabelGenerator(new StandardXYItemLabelGenerator());
assertTrue(r1.equals(r2));
r1.setSeriesToolTipGenerator(0, new StandardXYToolTipGenerator());
assertFalse(r1.equals(r2));
r2.setSeriesToolTipGenerator(0, new StandardXYToolTipGenerator());
assertTrue(r1.equals(r2));
r1.setBaseToolTipGenerator(new StandardXYToolTipGenerator());
assertFalse(r1.equals(r2));
r2.setBaseToolTipGenerator(new StandardXYToolTipGenerator());
assertTrue(r1.equals(r2));
r1.setSeriesURLGenerator(0, new StandardXYURLGenerator());
assertFalse(r1.equals(r2));
r2.setSeriesURLGenerator(0, new StandardXYURLGenerator());
assertTrue(r1.equals(r2));
r1.setBaseURLGenerator(new StandardXYURLGenerator());
assertFalse(r1.equals(r2));
r2.setBaseURLGenerator(new StandardXYURLGenerator());
assertTrue(r1.equals(r2));
r1.addAnnotation(new XYTextAnnotation("X", 1.0, 2.0), Layer.FOREGROUND);
assertFalse(r1.equals(r2));
r2.addAnnotation(new XYTextAnnotation("X", 1.0, 2.0), Layer.FOREGROUND);
assertTrue(r1.equals(r2));
r1.addAnnotation(new XYTextAnnotation("X", 1.0, 2.0), Layer.BACKGROUND);
assertFalse(r1.equals(r2));
r2.addAnnotation(new XYTextAnnotation("X", 1.0, 2.0), Layer.BACKGROUND);
assertTrue(r1.equals(r2));
r1.setDefaultEntityRadius(99);
assertFalse(r1.equals(r2));
r2.setDefaultEntityRadius(99);
assertTrue(r1.equals(r2));
r1.setLegendItemLabelGenerator(new StandardXYSeriesLabelGenerator(
"{0} {1}"));
assertFalse(r1.equals(r2));
r2.setLegendItemLabelGenerator(new StandardXYSeriesLabelGenerator(
"{0} {1}"));
assertTrue(r1.equals(r2));
r1.setLegendItemToolTipGenerator(new StandardXYSeriesLabelGenerator());
assertFalse(r1.equals(r2));
r2.setLegendItemToolTipGenerator(new StandardXYSeriesLabelGenerator());
assertTrue(r1.equals(r2));
r1.setLegendItemURLGenerator(new StandardXYSeriesLabelGenerator());
assertFalse(r1.equals(r2));
r2.setLegendItemURLGenerator(new StandardXYSeriesLabelGenerator());
assertTrue(r1.equals(r2));
r1.setAdditionalItemLabelGenerator(new IntervalXYItemLabelGenerator());
assertFalse(r1.equals(r2));
r2.setAdditionalItemLabelGenerator(new IntervalXYItemLabelGenerator());
assertTrue(r1.equals(r2));
}
示例10: testPublicCloneable
import org.jfree.chart.labels.StandardXYItemLabelGenerator; //导入依赖的package包/类
/**
* Check to ensure that this class implements PublicCloneable.
*/
public void testPublicCloneable() {
StandardXYItemLabelGenerator g1 = new StandardXYItemLabelGenerator();
assertTrue(g1 instanceof PublicCloneable);
}
示例11: createChart
import org.jfree.chart.labels.StandardXYItemLabelGenerator; //导入依赖的package包/类
@Override
protected JFreeChart createChart(CCMovieList movielist, StatisticsTypeFilter source) {
if (chart != null) return chart;
indexMap = new HashMap<>();
datasetList = new HashMap<>();
DateAxis dateAxis = new DateAxis(""); //$NON-NLS-1$
DateFormat chartFormatter = new SimpleDateFormat("dd.MM.yyyy"); //$NON-NLS-1$
dateAxis.setDateFormatOverride(chartFormatter);
valueAxis = new NumberAxis(""); //$NON-NLS-1$
valueAxis.setRange(0, 35);
plot = new XYPlot(new DefaultXYDataset(), dateAxis, valueAxis, new StandardXYItemRenderer(StandardXYItemRenderer.LINES, null, null));
List<TupleSeriesEpList> serieslist = getIncludedSeries(movielist);
CCDate startdate = GetStartDate(serieslist);
CCDate enddate = GetEndDate(serieslist);
int idx = 0;
for (TupleSeriesEpList series : serieslist) {
indexMap.put(series.series, idx);
Color cf = new Color(StatisticsHelper.CHART_COLORS[idx % StatisticsHelper.CHART_COLORS.length]);
Color ca = new Color(cf.getRed(), cf.getGreen(), cf.getBlue(), 178);
XYDataset dataset = getDataSet(series, startdate, enddate, false);
XYDataset startset = getDataSet(series, startdate, enddate, true);
datasetList.put(3*idx, dataset);
plot.setDataset(3*idx, dataset);
plot.setRenderer(3*idx, new XYAreaRenderer(XYAreaRenderer.AREA, null, null));
plot.getRenderer(3*idx).setSeriesPaint(0, ca);
plot.getRenderer(3*idx).setSeriesVisibleInLegend(0, false);
datasetList.put(3*idx + 1, dataset);
plot.setDataset(3*idx + 1, dataset);
plot.setRenderer(3*idx + 1, new StandardXYItemRenderer(StandardXYItemRenderer.LINES, null, null));
plot.getRenderer(3*idx + 1).setSeriesPaint(0, cf);
plot.getRenderer(3*idx + 1).setSeriesVisibleInLegend(0, false);
datasetList.put(3*idx + 2, startset);
plot.setDataset( 3*idx + 2, startset);
plot.setRenderer(3*idx + 2, new StandardXYItemRenderer(StandardXYItemRenderer.LINES, null, null));
plot.getRenderer(3*idx + 2).setSeriesPaint(0, cf);
plot.getRenderer(3*idx + 2).setSeriesVisibleInLegend(0, false);
plot.getRenderer(3*idx + 2).setBaseItemLabelGenerator(new StandardXYItemLabelGenerator("{0}")); //$NON-NLS-1$
plot.getRenderer(3*idx + 2).setBaseItemLabelPaint(cf);
plot.getRenderer(3*idx + 2).setBaseItemLabelsVisible(true);
plot.getRenderer(3*idx + 2).setBasePositiveItemLabelPosition(new ItemLabelPosition(ItemLabelAnchor.OUTSIDE12, TextAnchor.BOTTOM_LEFT, TextAnchor.BOTTOM_LEFT, -45));
plot.getRenderer(3*idx + 2).setSeriesItemLabelsVisible(0, true);
idx++;
}
domainTotalRangeMin = startdate.asMilliseconds();
domainTotalRangeMax = enddate.asMilliseconds();
if (domainTotalRangeMin == domainTotalRangeMax) domainTotalRangeMax++;
plot.setBackgroundPaint(XYBACKGROUND_COLOR);
plot.setDomainGridlinePaint(GRIDLINECOLOR);
plot.setRangeGridlinePaint(GRIDLINECOLOR);
chart = new JFreeChart(plot);
//chart.removeLegend();
chart.setBackgroundPaint(null);
plot.getDomainAxis().setTickLabelPaint(TEXT_FOREGROUND);
plot.getRangeAxis().setTickLabelPaint(TEXT_FOREGROUND);
plot.getRangeAxis().setStandardTickUnits(NumberAxis.createIntegerTickUnits());
domainAxis = plot.getDomainAxis();
return chart;
}