List of usage examples for java.awt Color lightGray
Color lightGray
To view the source code for java.awt Color lightGray.
Click Source Link
From source file:org.jfree.chart.demo.XYPointerAnnotationDemo1.java
private static JFreeChart createChart(XYDataset xydataset) { JFreeChart jfreechart = ChartFactory.createScatterPlot("XYPointerAnnotationDemo1", "X", "Y", xydataset, PlotOrientation.HORIZONTAL, true, true, false); jfreechart.setBackgroundPaint(Color.white); XYPlot xyplot = (XYPlot) jfreechart.getPlot(); xyplot.setBackgroundPaint(Color.lightGray); xyplot.setDomainGridlinePaint(Color.white); xyplot.setRangeGridlinePaint(Color.white); XYLineAndShapeRenderer xylineandshaperenderer = (XYLineAndShapeRenderer) xyplot.getRenderer(); XYPointerAnnotation xypointerannotation = new XYPointerAnnotation("Special point", 2.2000000000000002D, 6D, 3.9269908169872414D);// w ww. ja va 2 s . c om xypointerannotation.setTextAnchor(TextAnchor.BOTTOM_RIGHT); xypointerannotation.setToolTipText("The pointer has a tool tip!"); xylineandshaperenderer.addAnnotation(xypointerannotation, Layer.BACKGROUND); return jfreechart; }
From source file:OAT.ui.util.DefaultTheme.java
public DefaultTheme(String name) { super(name); this.setPlotBackgroundPaint(Color.lightGray); }
From source file:br.unicamp.cst.util.ChartViewerUtil.java
public static synchronized ChartPanel createLineXYChart(XYSeriesCollection dataset, String title, String categoryAxisLabel, String valueAxisLabel, long timeRefresh) { final JFreeChart chart = ChartFactory.createXYLineChart(title, categoryAxisLabel, valueAxisLabel, dataset, PlotOrientation.VERTICAL, true, true, false); final XYPlot plot = chart.getXYPlot(); plot.setBackgroundPaint(Color.lightGray); plot.setDomainGridlinePaint(Color.white); plot.setRangeGridlinePaint(Color.white); plot.getDomainAxis().setFixedAutoRange(timeRefresh * 100); chart.setBackgroundPaint(Color.lightGray); ChartPanel localChartPanel = new ChartPanel(chart); localChartPanel.setVisible(true);/* w ww .j a va2 s . c om*/ localChartPanel.setDomainZoomable(true); return localChartPanel; }
From source file:org.jfree.chart.demo.StackedXYAreaChartDemo1.java
private static JFreeChart createChart(TableXYDataset tablexydataset) { JFreeChart jfreechart = ChartFactory.createStackedXYAreaChart("Stacked XY Area Chart Demo 1", "X Value", "Y Value", tablexydataset, PlotOrientation.VERTICAL, true, true, false); XYPlot xyplot = (XYPlot) jfreechart.getPlot(); StackedXYAreaRenderer stackedxyarearenderer = new StackedXYAreaRenderer(); stackedxyarearenderer.setSeriesPaint(0, Color.lightGray); stackedxyarearenderer.setBaseToolTipGenerator(new StandardXYToolTipGenerator()); xyplot.setRenderer(0, stackedxyarearenderer); xyplot.setDomainCrosshairVisible(true); xyplot.setRangeCrosshairVisible(true); return jfreechart; }
From source file:org.jfree.chart.demo.QuarterDateFormatDemo.java
private static JFreeChart createChart(XYDataset xydataset) { JFreeChart jfreechart = ChartFactory.createTimeSeriesChart("Legal & General Unit Trust Prices", "Date", "Price Per Unit", xydataset, true, true, false); jfreechart.setBackgroundPaint(Color.white); XYPlot xyplot = (XYPlot) jfreechart.getPlot(); PeriodAxis periodaxis = new PeriodAxis("Quarter", new Quarter(), new Quarter()); periodaxis.setAutoRangeTimePeriodClass(org.jfree.data.time.Quarter.class); PeriodAxisLabelInfo aperiodaxislabelinfo[] = new PeriodAxisLabelInfo[1]; aperiodaxislabelinfo[0] = new PeriodAxisLabelInfo(org.jfree.data.time.Quarter.class, new QuarterDateFormat(TimeZone.getDefault(), QuarterDateFormat.ROMAN_QUARTERS)); periodaxis.setLabelInfo(aperiodaxislabelinfo); xyplot.setDomainAxis(periodaxis);/*from w w w .j av a 2 s . co m*/ xyplot.setBackgroundPaint(Color.lightGray); xyplot.setDomainGridlinePaint(Color.white); xyplot.setRangeGridlinePaint(Color.white); xyplot.setAxisOffset(new RectangleInsets(5D, 5D, 5D, 5D)); xyplot.setDomainCrosshairVisible(true); xyplot.setRangeCrosshairVisible(true); org.jfree.chart.renderer.xy.XYItemRenderer xyitemrenderer = xyplot.getRenderer(); if (xyitemrenderer instanceof XYLineAndShapeRenderer) { XYLineAndShapeRenderer xylineandshaperenderer = (XYLineAndShapeRenderer) xyitemrenderer; xylineandshaperenderer.setBaseShapesVisible(true); xylineandshaperenderer.setBaseShapesFilled(true); } return jfreechart; }
From source file:org.jfree.chart.demo.CategoryMarkerDemo1.java
private static JFreeChart createChart(CategoryDataset categorydataset) { JFreeChart jfreechart = ChartFactory.createLineChart("Category Marker Demo 1", "Category", "Count", categorydataset, PlotOrientation.VERTICAL, true, true, false); jfreechart.setBackgroundPaint(Color.white); CategoryPlot categoryplot = (CategoryPlot) jfreechart.getPlot(); categoryplot.setBackgroundPaint(Color.lightGray); categoryplot.setRangeGridlinePaint(Color.white); NumberAxis numberaxis = (NumberAxis) categoryplot.getRangeAxis(); numberaxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits()); LineAndShapeRenderer lineandshaperenderer = (LineAndShapeRenderer) categoryplot.getRenderer(); lineandshaperenderer.setSeriesShapesVisible(0, true); lineandshaperenderer.setDrawOutlines(true); lineandshaperenderer.setUseFillPaint(true); lineandshaperenderer.setBaseFillPaint(Color.white); CategoryMarker categorymarker = new CategoryMarker("Category 4", Color.blue, new BasicStroke(1.0F)); categorymarker.setDrawAsLine(true);// ww w .j av a 2 s. co m categorymarker.setLabel("Marker Label"); categorymarker.setLabelFont(new Font("Dialog", 0, 11)); categorymarker.setLabelTextAnchor(TextAnchor.TOP_RIGHT); categorymarker.setLabelOffset(new RectangleInsets(2D, 5D, 2D, 5D)); categoryplot.addDomainMarker(categorymarker, Layer.BACKGROUND); return jfreechart; }
From source file:Charts.LineChart.java
@Override protected JFreeChart createChart(String title, String x, String y) { JFreeChart lineChart = this.makeJFreeChart(title, x, y); // Custom chart.. lineChart.setBackgroundPaint(Color.white); final XYPlot plot = lineChart.getXYPlot(); plot.setBackgroundPaint(Color.white); plot.setDomainGridlinePaint(Color.lightGray); plot.setRangeGridlinePaint(Color.lightGray); final XYLineAndShapeRenderer renderer = new XYLineAndShapeRenderer(); renderer.setSeriesShapesVisible(0, false); plot.setRenderer(renderer);/*from w w w . j a v a 2 s .c om*/ return lineChart; }
From source file:org.jfree.chart.demo.CategoryMarkerDemo2.java
private static JFreeChart createChart(CategoryDataset categorydataset) { JFreeChart jfreechart = ChartFactory.createLineChart("Category Marker Demo 2", "Category", "Count", categorydataset, PlotOrientation.VERTICAL, true, true, false); jfreechart.setBackgroundPaint(Color.white); CategoryPlot categoryplot = (CategoryPlot) jfreechart.getPlot(); categoryplot.setBackgroundPaint(Color.lightGray); categoryplot.setRangeGridlinePaint(Color.white); NumberAxis numberaxis = (NumberAxis) categoryplot.getRangeAxis(); numberaxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits()); LineAndShapeRenderer lineandshaperenderer = (LineAndShapeRenderer) categoryplot.getRenderer(); lineandshaperenderer.setSeriesShapesVisible(0, true); lineandshaperenderer.setDrawOutlines(true); lineandshaperenderer.setUseFillPaint(true); lineandshaperenderer.setBaseFillPaint(Color.white); CategoryMarker categorymarker = new CategoryMarker("Category 4", new Color(0, 0, 255, 25), new BasicStroke(1.0F)); categorymarker.setDrawAsLine(false); categorymarker.setAlpha(1.0F);//w w w.jav a 2s . c o m categorymarker.setLabel("Marker Label"); categorymarker.setLabelFont(new Font("Dialog", 0, 11)); categorymarker.setLabelTextAnchor(TextAnchor.TOP_RIGHT); categorymarker.setLabelOffset(new RectangleInsets(2D, 5D, 2D, 5D)); categoryplot.addDomainMarker(categorymarker, Layer.BACKGROUND); return jfreechart; }
From source file:org.jfree.chart.demo.XYBlockChartDemo3.java
private static JFreeChart createChart(XYZDataset xyzdataset) { NumberAxis numberaxis = new NumberAxis("X"); numberaxis.setLowerMargin(0.0D);/*from w w w . j av a2 s .co m*/ numberaxis.setUpperMargin(0.0D); NumberAxis numberaxis1 = new NumberAxis("Y"); numberaxis1.setAutoRangeIncludesZero(false); numberaxis1.setInverted(true); numberaxis1.setLowerMargin(0.0D); numberaxis1.setUpperMargin(0.0D); numberaxis1.setStandardTickUnits(NumberAxis.createIntegerTickUnits()); XYBlockRenderer xyblockrenderer = new XYBlockRenderer(); LookupPaintScale lookuppaintscale = new LookupPaintScale(0.5D, 3.5D, Color.black); lookuppaintscale.add(0.5D, Color.green); lookuppaintscale.add(1.5D, Color.orange); lookuppaintscale.add(2.5D, Color.red); xyblockrenderer.setPaintScale(lookuppaintscale); XYPlot xyplot = new XYPlot(xyzdataset, numberaxis, numberaxis1, xyblockrenderer); xyplot.setBackgroundPaint(Color.lightGray); xyplot.setDomainGridlinePaint(Color.white); xyplot.setRangeGridlinePaint(Color.white); xyplot.setForegroundAlpha(0.66F); xyplot.setAxisOffset(new RectangleInsets(5D, 5D, 5D, 5D)); JFreeChart jfreechart = new JFreeChart("XYBlockChartDemo3", xyplot); jfreechart.removeLegend(); jfreechart.setBackgroundPaint(Color.white); SymbolAxis symbolaxis = new SymbolAxis(null, new String[] { "", "OK", "Uncertain", "Bad" }); symbolaxis.setRange(0.5D, 3.5D); symbolaxis.setPlot(new PiePlot()); symbolaxis.setGridBandsVisible(false); PaintScaleLegend paintscalelegend = new PaintScaleLegend(lookuppaintscale, symbolaxis); paintscalelegend.setAxisOffset(5D); paintscalelegend.setPosition(RectangleEdge.BOTTOM); paintscalelegend.setMargin(new RectangleInsets(5D, 5D, 5D, 5D)); jfreechart.addSubtitle(paintscalelegend); return jfreechart; }
From source file:org.jfree.chart.demo.XYBarChartDemo1.java
private static JFreeChart createChart(IntervalXYDataset intervalxydataset) { JFreeChart jfreechart = ChartFactory.createXYBarChart("State Executions - USA", "Year", true, "Number of People", intervalxydataset, PlotOrientation.VERTICAL, true, false, false); jfreechart.addSubtitle(new TextTitle("Source: http://www.amnestyusa.org/abolish/listbyyear.do", new Font("Dialog", 2, 10))); jfreechart.setBackgroundPaint(Color.white); XYPlot xyplot = (XYPlot) jfreechart.getPlot(); XYItemRenderer xyitemrenderer = xyplot.getRenderer(); StandardXYToolTipGenerator standardxytooltipgenerator = new StandardXYToolTipGenerator("{1} = {2}", new SimpleDateFormat("yyyy"), new DecimalFormat("0")); xyitemrenderer.setBaseToolTipGenerator(standardxytooltipgenerator); xyplot.setBackgroundPaint(Color.lightGray); xyplot.setRangeGridlinePaint(Color.white); DateAxis dateaxis = (DateAxis) xyplot.getDomainAxis(); dateaxis.setTickMarkPosition(DateTickMarkPosition.MIDDLE); dateaxis.setLowerMargin(0.01D);/* w w w .j a v a 2s .co m*/ dateaxis.setUpperMargin(0.01D); return jfreechart; }