List of usage examples for org.jfree.chart.plot XYPlot addRangeMarker
public void addRangeMarker(Marker marker)
From source file:net.liuxuan.device.w3330.JIF_DrawChart_w3330.java
private void chartDrawHerizonLine(W3330MetaData data, Color color, String Labelstr) { XYPlot plot = (XYPlot) chartPanel.getChart().getPlot(); final Marker start = new ValueMarker(data.zero); start.setPaint(color);//from w w w .ja v a2s . c o m start.setLabel(Labelstr); start.setLabelAnchor(RectangleAnchor.BOTTOM_LEFT); start.setLabelTextAnchor(TextAnchor.TOP_LEFT); start.setLabelPaint(color); plot.addRangeMarker(start); }
From source file:gui.QTLResultsPanel.java
private JPanel getChart(Trait trait) { JFreeChart chart = ChartFactory.createXYLineChart(null, "Position (cM)", "LOD Score", null, PlotOrientation.VERTICAL, true, true, false); setChartData(chart, trait);/*from w w w. j a v a 2 s. c om*/ RenderingHints rh = new RenderingHints(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF); chart.setRenderingHints(rh); chart.removeLegend(); XYPlot plot = chart.getXYPlot(); plot.setBackgroundPaint(new Color(255, 255, 220)); plot.setDomainGridlinePaint(new Color(128, 128, 128)); plot.setRangeGridlinePaint(new Color(128, 128, 128)); ValueAxis axis = plot.getRangeAxis(); if (trait.maxLOD <= 3) { axis.setUpperBound(3); } PermResult result = trait.getPermResult(); if (result != null) { float[] dashPattern = { 5, 5 }; BasicStroke s1 = new BasicStroke(1, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER, 10, dashPattern, 0); ValueMarker m1 = new ValueMarker(result.getSig90(), new Color(0, 0, 60), s1, null, null, 1.0f); ValueMarker m2 = new ValueMarker(result.getSig95(), new Color(0, 0, 60), s1, null, null, 1.0f); plot.addRangeMarker(m1); plot.addRangeMarker(m2); if (result.getSig95() > trait.maxLOD && result.getSig95() >= 3) { axis.setUpperBound(result.getSig95() * (1.05)); } } chartPanel = new ChartPanel(chart); chartPanel.setPopupMenu(null); return chartPanel; }
From source file:org.jstockchart.plot.TimeseriesPlot.java
private XYPlot createPricePlot() { Font axisFont = new Font("Arial", 0, 12); Stroke stroke = new BasicStroke(1f, BasicStroke.CAP_BUTT, BasicStroke.CAP_SQUARE, 0.0f, new float[] { 1.0f, 1.0f }, 1.0f); PriceArea priceArea = timeseriesArea.getPriceArea(); Color averageColor = new Color(243, 182, 117); priceArea.setAverageColor(averageColor); priceArea.setPriceColor(Color.BLUE); TimeSeriesCollection priceDataset = new TimeSeriesCollection(); priceDataset.addSeries(dataset.getPriceTimeSeries().getTimeSeries()); if (priceArea.isAverageVisible()) { priceDataset.addSeries(dataset.getAverageTimeSeries().getTimeSeries()); }/*from ww w .j av a2s. co m*/ CentralValueAxis logicPriceAxis = priceArea.getLogicPriceAxis(); logicPriceAxis.setTickCount(7); CFXNumberAxis priceAxis = new CFXNumberAxis(logicPriceAxis.getLogicTicks()); priceAxis.setShowUD(true); priceAxis.setOpenPrice(logicPriceAxis.getCentralValue().doubleValue()); priceAxis.setTickMarksVisible(false); XYLineAndShapeRenderer priceRenderer = new XYLineAndShapeRenderer(true, false); priceAxis.setUpperBound(logicPriceAxis.getUpperBound()); priceAxis.setLowerBound(logicPriceAxis.getLowerBound()); priceAxis.setAxisLineVisible(false); priceAxis.setTickLabelFont(axisFont); priceRenderer.setSeriesPaint(0, priceArea.getPriceColor()); priceRenderer.setSeriesPaint(1, priceArea.getAverageColor()); CFXNumberAxis rateAxis = new CFXNumberAxis(logicPriceAxis.getRatelogicTicks()); rateAxis.setShowUD(true); rateAxis.setOpenPrice(logicPriceAxis.getCentralValue().doubleValue()); rateAxis.setTickMarksVisible(false); ; rateAxis.setTickLabelFont(axisFont); rateAxis.setAxisLineVisible(false); rateAxis.setUpperBound(logicPriceAxis.getUpperBound()); rateAxis.setLowerBound(logicPriceAxis.getLowerBound()); XYPlot plot = new XYPlot(priceDataset, null, priceAxis, priceRenderer); plot.setBackgroundPaint(priceArea.getBackgroudColor()); plot.setOrientation(priceArea.getOrientation()); plot.setRangeAxisLocation(priceArea.getPriceAxisLocation()); plot.setRangeMinorGridlinesVisible(false); Stroke outLineStroke = new BasicStroke(1f, BasicStroke.CAP_BUTT, BasicStroke.CAP_SQUARE, 0.0f, new float[] { 1.0f, 1.0f }, 1.0f); Stroke gridLineStroke = new BasicStroke(0.5f, BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL, 0.0f, new float[] { 2.0f, 2.0f }, 1.0f); plot.setRangeGridlineStroke(gridLineStroke); plot.setDomainGridlineStroke(gridLineStroke); plot.setRangeGridlinesVisible(true); plot.setDomainGridlinesVisible(true); plot.setOutlineVisible(true); plot.setOutlineStroke(outLineStroke); plot.setOutlinePaint(Color.BLACK); if (priceArea.isRateVisible()) { plot.setRangeAxis(1, rateAxis); plot.setRangeAxisLocation(1, priceArea.getRateAxisLocation()); plot.setDataset(1, null); plot.mapDatasetToRangeAxis(1, 1); } if (priceArea.isMarkCentralValue()) { Number centralPrice = logicPriceAxis.getCentralValue(); if (centralPrice != null) { plot.addRangeMarker(new ValueMarker(centralPrice.doubleValue(), priceArea.getCentralPriceColor(), new BasicStroke())); } } return plot; }
From source file:org.trade.ui.chart.CandlestickChart.java
/** * Method seriesChanged.// ww w .j a v a2 s.co m * * @param event * SeriesChangeEvent * @see org.jfree.data.general.SeriesChangeListener#seriesChanged(SeriesChangeEvent) */ public void seriesChanged(SeriesChangeEvent event) { Object series = event.getSource(); if (series instanceof CandleSeries) { CandleSeries candleSeries = (CandleSeries) series; if (!candleSeries.isEmpty()) { CombinedDomainXYPlot combinedXYplot = (CombinedDomainXYPlot) this.chart.getPlot(); @SuppressWarnings("unchecked") List<XYPlot> subplots = combinedXYplot.getSubplots(); XYPlot xyplot = subplots.get(0); CandleItem candleItem = (CandleItem) candleSeries.getDataItem(candleSeries.getItemCount() - 1); String msg = "Time: " + dateFormat.format(candleItem.getLastUpdateDate()) + " Open: " + new Money(candleItem.getOpen()) + " High: " + new Money(candleItem.getHigh()) + " Low: " + new Money(candleItem.getLow()) + " Close: " + new Money(candleItem.getClose()) + " Vwap: " + new Money(candleItem.getVwap()); titleLegend2.setText(msg); valueMarker.setValue(candleItem.getClose()); double x = TradingCalendar .getSpecificTime(candleSeries.getStartTime(), candleItem.getPeriod().getStart()).getTime(); String annotationText = "(" + dateFormat.format(candleItem.getLastUpdateDate()) + ", " + new Money(candleItem.getClose()) + ")"; if (null == closePriceLine) { closePriceLine = new XYTextAnnotation(annotationText, x, candleItem.getY()); closePriceLine.setTextAnchor(TextAnchor.BOTTOM_RIGHT); xyplot.addAnnotation(closePriceLine); xyplot.addRangeMarker(valueMarker); } else { closePriceLine.setText(annotationText); closePriceLine.setX(x); closePriceLine.setY(candleItem.getY()); } this.chart.fireChartChanged(); } } }
From source file:sanger.team16.gui.genevar.eqtl.gene.RegionalPlot.java
private JFreeChart createChart(String geneChromosome, int geneStart, int distanceToTSS, double threshold, XYDataset dataset) {/* w w w.j a v a2 s . c om*/ JFreeChart chart = ChartFactory.createScatterPlot(null, "Position on chromosome " + geneChromosome + " (bp)", "-log10(P)", dataset, PlotOrientation.VERTICAL, true, true, false); XYPlot plot = (XYPlot) chart.getPlot(); plot.setBackgroundPaint(Color.WHITE); plot.setDomainGridlinePaint(Color.lightGray); //plot.setRangeGridlinePaint(Color.lightGray); //plot.setRangeCrosshairVisible(true); //NumberAxis domainAxis = (NumberAxis) plot.getDomainAxis(); //domainAxis.setRange(geneStart - distance, geneStart + distance); //domainAxis.setUpperMargin(1000); //domainAxis.setLowerMargin(1000); //ValueAxis rangeAxis = plot.getRangeAxis(); //rangeAxis.setUpperMargin(dataset.getYValue(0, 0)/5); //rangeAxis.setLowerBound(0); XYItemRenderer renderer = plot.getRenderer(); int size = dataset.getSeriesCount(); for (int i = 0; i < size; i++) { //int scale = (int) Math.round((255 - (255 * dataset.getYValue(i, 0)) / top) / 1.4); //renderer.setSeriesPaint(i, new Color(255, scale, scale)); renderer.setSeriesPaint(i, new Color(255, 0, 0)); renderer.setSeriesShape(i, ShapeUtilities.createDiamond((float) 3)); renderer.setBaseSeriesVisibleInLegend(false); } ValueMarker upperMarker = new ValueMarker(-Math.log10(threshold)); upperMarker.setPaint(Color.gray); //upperMarker.setLabelOffsetType(LengthAdjustmentType.EXPAND); //upperMarker.setLabel("-log10(10E-4)"); //upperMarker.setLabelPaint(Color.red); //upperMarker.setLabelAnchor(RectangleAnchor.TOP_RIGHT); //upperMarker.setLabelTextAnchor(TextAnchor.BOTTOM_RIGHT); float[] f = { 4, 3, 4, 3 }; upperMarker.setStroke(new BasicStroke(1.0f, 1, 1, 0, f, 1.0f)); plot.addRangeMarker(upperMarker); ValueMarker marker = new ValueMarker(0.0); marker.setPaint(Color.lightGray); plot.addRangeMarker(marker); XYSeries series = new XYSeries("Range"); series.add(geneStart - distanceToTSS, -0.05); series.add(geneStart + distanceToTSS, -0.05); ((XYSeriesCollection) dataset).addSeries(series); renderer.setSeriesVisible(dataset.getSeriesCount() - 1, false, false); return chart; }
From source file:sanger.team16.gui.genevar.mqtl.gene.RegionalPlot.java
private JFreeChart createChart(String geneChromosome, int geneStart, int distanceToTSS, double threshold, XYDataset dataset) {//from ww w.j a va 2 s. c om JFreeChart chart = ChartFactory.createScatterPlot(null, "Position on chromosome " + geneChromosome + " (bp)", "-log10(P)", dataset, PlotOrientation.VERTICAL, true, true, false); XYPlot plot = (XYPlot) chart.getPlot(); plot.setBackgroundPaint(Color.WHITE); plot.setDomainGridlinePaint(Color.lightGray); //plot.setRangeGridlinePaint(Color.lightGray); //plot.setRangeCrosshairVisible(true); //NumberAxis domainAxis = (NumberAxis) plot.getDomainAxis(); //domainAxis.setRange(geneStart - distance, geneStart + distance); //domainAxis.setUpperMargin(1000); //domainAxis.setLowerMargin(1000); //ValueAxis rangeAxis = plot.getRangeAxis(); //rangeAxis.setUpperMargin(dataset.getYValue(0, 0)/5); //rangeAxis.setLowerBound(0); XYItemRenderer renderer = plot.getRenderer(); int size = dataset.getSeriesCount(); for (int i = 0; i < size; i++) { //int scale = (int) Math.round((255 - (255 * dataset.getYValue(i, 0)) / top) / 1.4); //renderer.setSeriesPaint(i, new Color(255, scale, scale)); renderer.setSeriesPaint(i, new Color(50, 205, 50)); renderer.setSeriesShape(i, ShapeUtilities.createDiamond((float) 3)); renderer.setBaseSeriesVisibleInLegend(false); } ValueMarker upperMarker = new ValueMarker(-Math.log10(threshold)); upperMarker.setPaint(Color.gray); //upperMarker.setLabelOffsetType(LengthAdjustmentType.EXPAND); //upperMarker.setLabel("-log10(10E-4)"); //upperMarker.setLabelPaint(Color.red); //upperMarker.setLabelAnchor(RectangleAnchor.TOP_RIGHT); //upperMarker.setLabelTextAnchor(TextAnchor.BOTTOM_RIGHT); float[] f = { 4, 3, 4, 3 }; upperMarker.setStroke(new BasicStroke(1.0f, 1, 1, 0, f, 1.0f)); plot.addRangeMarker(upperMarker); ValueMarker marker = new ValueMarker(0.0); marker.setPaint(Color.lightGray); plot.addRangeMarker(marker); XYSeries series = new XYSeries("Range"); series.add(geneStart - distanceToTSS, -0.05); series.add(geneStart + distanceToTSS, -0.05); ((XYSeriesCollection) dataset).addSeries(series); renderer.setSeriesVisible(dataset.getSeriesCount() - 1, false, false); return chart; }
From source file:com.android.ddmuilib.net.NetworkPanel.java
/** * Create chart of recent network activity. *///from w w w . j ava 2 s . com private void createChart() { mChart = ChartFactory.createTimeSeriesChart(null, null, null, null, false, false, false); // create backing datasets and series mRxTotalSeries = new TimeSeries("RX total"); mTxTotalSeries = new TimeSeries("TX total"); mRxTotalSeries.setMaximumItemAge(HISTORY_MILLIS); mTxTotalSeries.setMaximumItemAge(HISTORY_MILLIS); mTotalCollection = new TimeSeriesCollection(); mTotalCollection.addSeries(mRxTotalSeries); mTotalCollection.addSeries(mTxTotalSeries); mRxDetailDataset = new LiveTimeTableXYDataset(); mTxDetailDataset = new LiveTimeTableXYDataset(); mTotalRenderer = new XYAreaRenderer(XYAreaRenderer.AREA); mRenderer = new StackedXYAreaRenderer2(); final XYPlot xyPlot = mChart.getXYPlot(); xyPlot.setDatasetRenderingOrder(DatasetRenderingOrder.FORWARD); xyPlot.setDataset(0, mTotalCollection); xyPlot.setDataset(1, mRxDetailDataset); xyPlot.setDataset(2, mTxDetailDataset); xyPlot.setRenderer(0, mTotalRenderer); xyPlot.setRenderer(1, mRenderer); xyPlot.setRenderer(2, mRenderer); // we control domain axis manually when taking samples mDomainAxis = xyPlot.getDomainAxis(); mDomainAxis.setAutoRange(false); final NumberAxis axis = new NumberAxis(); axis.setNumberFormatOverride(new BytesFormat(true)); axis.setAutoRangeMinimumSize(50); xyPlot.setRangeAxis(axis); xyPlot.setRangeAxisLocation(AxisLocation.BOTTOM_OR_RIGHT); // draw thick line to separate RX versus TX traffic xyPlot.addRangeMarker(new ValueMarker(0, java.awt.Color.BLACK, new java.awt.BasicStroke(2))); // label to indicate that positive axis is RX traffic final ValueMarker rxMarker = new ValueMarker(0); rxMarker.setStroke(new java.awt.BasicStroke(0)); rxMarker.setLabel("RX"); rxMarker.setLabelFont(rxMarker.getLabelFont().deriveFont(30f)); rxMarker.setLabelPaint(java.awt.Color.LIGHT_GRAY); rxMarker.setLabelAnchor(RectangleAnchor.TOP_RIGHT); rxMarker.setLabelTextAnchor(TextAnchor.BOTTOM_RIGHT); xyPlot.addRangeMarker(rxMarker); // label to indicate that negative axis is TX traffic final ValueMarker txMarker = new ValueMarker(0); txMarker.setStroke(new java.awt.BasicStroke(0)); txMarker.setLabel("TX"); txMarker.setLabelFont(txMarker.getLabelFont().deriveFont(30f)); txMarker.setLabelPaint(java.awt.Color.LIGHT_GRAY); txMarker.setLabelAnchor(RectangleAnchor.BOTTOM_RIGHT); txMarker.setLabelTextAnchor(TextAnchor.TOP_RIGHT); xyPlot.addRangeMarker(txMarker); mChartComposite = new ChartComposite(mPanel, SWT.BORDER, mChart, ChartComposite.DEFAULT_WIDTH, ChartComposite.DEFAULT_HEIGHT, ChartComposite.DEFAULT_MINIMUM_DRAW_WIDTH, ChartComposite.DEFAULT_MINIMUM_DRAW_HEIGHT, 4096, 4096, true, true, true, true, false, true); final FormData data = new FormData(); data.top = new FormAttachment(mHeader); data.left = new FormAttachment(0); data.bottom = new FormAttachment(70); data.right = new FormAttachment(100); mChartComposite.setLayoutData(data); }
From source file:com.jtstand.swing.StatsPanel.java
public void placeLimitMarkers(XYPlot plot, boolean range) { if (testStepInstances.getReferenceStep() != null && testStepInstances.getReferenceStep().getTestLimit() != null) { if (testStepInstances.getReferenceStep().getTestLimit().getLowerSpecifiedLimit() != null) { final Marker lsl = new ValueMarker( testStepInstances.getReferenceStep().getTestLimit().getLowerSpecifiedLimit()); lsl.setPaint(limitcolor);/*w w w. ja v a2 s.c om*/ lsl.setLabel("LSL"); if (range) { lsl.setLabelAnchor(RectangleAnchor.BOTTOM_RIGHT); lsl.setLabelTextAnchor(TextAnchor.TOP_RIGHT); plot.addRangeMarker(lsl); } else { lsl.setLabelAnchor(RectangleAnchor.TOP_LEFT); lsl.setLabelTextAnchor(TextAnchor.TOP_RIGHT); plot.addDomainMarker(lsl); } } if (testStepInstances.getReferenceStep().getTestLimit().getUpperSpeficiedLimit() != null) { final Marker usl = new ValueMarker( testStepInstances.getReferenceStep().getTestLimit().getUpperSpeficiedLimit()); usl.setPaint(limitcolor); usl.setLabel("USL"); if (range) { usl.setLabelAnchor(RectangleAnchor.TOP_RIGHT); usl.setLabelTextAnchor(TextAnchor.BOTTOM_RIGHT); plot.addRangeMarker(usl); } else { usl.setLabelAnchor(RectangleAnchor.TOP_RIGHT); usl.setLabelTextAnchor(TextAnchor.TOP_LEFT); plot.addDomainMarker(usl); } } } }
From source file:com.appnativa.rare.ui.chart.jfreechart.ChartHandler.java
protected void updateMarkers(ChartDefinition cd, XYPlot plot, boolean range) { List<ChartDataItem> markers = range ? cd.getRangeMarkers() : cd.getDomainMarkers(); int len = (markers == null) ? 0 : markers.size(); len = (markers == null) ? 0 : markers.size(); if (range) {/* ww w . j a va2 s .co m*/ plot.clearRangeMarkers(); for (int i = 0; i < len; i++) { plot.addRangeMarker(ChartHelper.createIntervalMarker(markers.get(i))); } } else { plot.clearDomainMarkers(); IntervalMarker marker; ChartAxis.TimeUnit tm = cd.getDomainAxis().getTimeUnit(); boolean time = cd.isDateTimeType(); customizeAxis(cd, cd.getRangeAxis(), (NumberAxis) plot.getRangeAxis()); customizeAxis(cd, cd.getDomainAxis(), (NumberAxis) plot.getDomainAxis()); for (int i = 0; i < len; i++) { marker = time ? ChartHelper.createIntervalMarker(markers.get(i), tm) : ChartHelper.createIntervalMarker(markers.get(i)); plot.addDomainMarker(marker); } } }
From source file:org.gwaspi.gui.reports.ManhattanPlotZoom.java
private JFreeChart createChart(XYDataset dataset, ChromosomeKey chr) { JFreeChart chart = ChartFactory.createScatterPlot(null, "", "P value", dataset, PlotOrientation.VERTICAL, true, false, false);// w w w.ja va 2 s . c o m XYPlot plot = (XYPlot) chart.getPlot(); plot.setNoDataMessage("NO DATA"); plot.setDomainZeroBaselineVisible(true); plot.setRangeZeroBaselineVisible(true); // CHART BACKGROUD COLOR chart.setBackgroundPaint(Color.getHSBColor(0.1f, 0.1f, 1.0f)); // Hue, saturation, brightness plot.setBackgroundPaint(manhattan_back); // Hue, saturation, brightness 9 // GRIDLINES plot.setDomainGridlineStroke(new BasicStroke(0.0f)); plot.setDomainMinorGridlineStroke(new BasicStroke(0.0f)); plot.setDomainGridlinePaint(manhattan_back.darker().darker()); // Hue, saturation, brightness 7 plot.setDomainMinorGridlinePaint(manhattan_back); // Hue, saturation, brightness 9 plot.setRangeGridlineStroke(new BasicStroke(0.0f)); plot.setRangeMinorGridlineStroke(new BasicStroke(0.0f)); plot.setRangeGridlinePaint(manhattan_back.darker().darker()); // Hue, saturation, brightness 7 plot.setRangeMinorGridlinePaint(manhattan_back.darker()); // Hue, saturation, brightness 8 plot.setDomainMinorGridlinesVisible(true); plot.setRangeMinorGridlinesVisible(true); // DOTS RENDERER XYLineAndShapeRenderer renderer = (XYLineAndShapeRenderer) plot.getRenderer(); renderer.setSeriesPaint(0, manhattan_dot); // renderer.setSeriesOutlinePaint(0, Color.DARK_GRAY); // renderer.setUseOutlinePaint(true); // Set dot shape of the currently appended Series renderer.setSeriesShape(0, new Rectangle2D.Double(0.0, 0.0, 2, 2)); renderer.setSeriesVisibleInLegend(0, false); NumberAxis positionAxis = (NumberAxis) plot.getDomainAxis(); // domainAxis.setAutoRangeIncludesZero(false); // domainAxis.setTickMarkInsideLength(2.0f); // domainAxis.setTickMarkOutsideLength(2.0f); // domainAxis.setMinorTickCount(2); // domainAxis.setMinorTickMarksVisible(true); positionAxis.setLabelAngle(1.0); positionAxis.setAutoRangeIncludesZero(false); positionAxis.setAxisLineVisible(true); positionAxis.setTickLabelsVisible(true); positionAxis.setTickMarksVisible(true); // ADD INVERSE LOG(10) Y AXIS LogAxis logPAxis = new LogAxis("P value"); logPAxis.setBase(10); logPAxis.setInverted(true); logPAxis.setNumberFormatOverride(GenericReportGenerator.FORMAT_P_VALUE); logPAxis.setTickMarkOutsideLength(2.0f); logPAxis.setMinorTickCount(2); logPAxis.setMinorTickMarksVisible(true); logPAxis.setAxisLineVisible(true); logPAxis.setUpperMargin(0); TickUnitSource units = NumberAxis.createIntegerTickUnits(); logPAxis.setStandardTickUnits(units); plot.setRangeAxis(0, logPAxis); // Add significance Threshold to subplot //threshold = 0.5/rdMatrixMetadata.getMarkerSetSize(); // (0.05/10? SNPs => 5*10-?) final Marker thresholdLine = new ValueMarker(threshold); thresholdLine.setPaint(Color.red); // Add legend to threshold thresholdLine.setLabel("P = " + GenericReportGenerator.FORMAT_P_VALUE.format(threshold)); thresholdLine.setLabelAnchor(RectangleAnchor.TOP_RIGHT); thresholdLine.setLabelTextAnchor(TextAnchor.BOTTOM_RIGHT); plot.addRangeMarker(thresholdLine); // Marker label if below threshold XYItemRenderer lblRenderer = plot.getRenderer(); // THRESHOLD AND SELECTED LABEL GENERATOR MySeriesItemLabelGenerator lblGenerator = new MySeriesItemLabelGenerator(threshold, chr); lblRenderer.setSeriesItemLabelGenerator(0, lblGenerator); lblRenderer.setSeriesItemLabelFont(0, new Font("SansSerif", Font.PLAIN, 12)); lblRenderer.setSeriesPositiveItemLabelPosition(0, new ItemLabelPosition(ItemLabelAnchor.CENTER, TextAnchor.TOP_LEFT, TextAnchor.BOTTOM_LEFT, Math.PI / 4.0)); // TOOLTIP GENERATOR MyXYToolTipGenerator tooltipGenerator = new MyXYToolTipGenerator(chr); lblRenderer.setBaseToolTipGenerator(tooltipGenerator); lblRenderer.setSeriesItemLabelsVisible(0, true); return chart; }