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:DashboardInterface.TensionSpeedDial.java
public TensionSpeedDial(JPanel parentIn) { super(new BorderLayout()); parent = parentIn;/*w ww . j a v a 2 s . c o m*/ dataset1 = new DefaultValueDataset(0D); dataset2 = new DefaultValueDataset(0D); pipe = MessagePipeline.getInstance(); pipe.attach(this); DialPlot dialplot = new DialPlot(); dialplot.setView(0.0D, 0.0D, 1.0D, 1.0D); dialplot.setDataset(0, dataset1); dialplot.setDataset(1, dataset2); setBackground(Color.WHITE); StandardDialFrame standarddialframe = new StandardDialFrame(); standarddialframe.setBackgroundPaint(Color.lightGray); standarddialframe.setForegroundPaint(Color.darkGray); dialplot.setDialFrame(standarddialframe); DialBackground dialbackground = new DialBackground(Color.LIGHT_GRAY); dialbackground.setGradientPaintTransformer( new StandardGradientPaintTransformer(GradientPaintTransformType.VERTICAL)); dialplot.setBackground(dialbackground); DialTextAnnotation dialtextannotation = new DialTextAnnotation("Tension (lbf)"); dialtextannotation.setFont(new Font("Dialog", 1, 12)); dialtextannotation.setPaint(Color.RED); dialtextannotation.setRadius(0.47999999999999996D); dialplot.addLayer(dialtextannotation); DialTextAnnotation dialtextannotation2 = new DialTextAnnotation("Speed (kts)"); dialtextannotation2.setFont(new Font("Dialog", 1, 12)); dialtextannotation2.setPaint(Color.BLUE); dialtextannotation2.setRadius(0.78999999999999996D); dialplot.addLayer(dialtextannotation2); /*DialValueIndicator dialvalueindicator = new DialValueIndicator(0); dialvalueindicator.setFont(new Font("Dialog", 0, 10)); dialvalueindicator.setOutlinePaint(Color.BLACK); dialvalueindicator.setRadius(0.84999999999999998D); dialvalueindicator.setAngle(-90D); dialplot.addLayer(dialvalueindicator); DialValueIndicator dialvalueindicator1 = new DialValueIndicator(1); dialvalueindicator1.setFont(new Font("Dialog", 0, 10)); dialvalueindicator1.setOutlinePaint(Color.BLACK); dialvalueindicator1.setRadius(0.60999999999999998D); dialvalueindicator1.setAngle(-90D); dialplot.addLayer(dialvalueindicator1);*/ StandardDialScale standarddialscale = new StandardDialScale(0D, 90D, -120D, -300D, 10D, 4); standarddialscale.setTickRadius(0.88D); standarddialscale.setTickLabelOffset(0.14999999999999999D); standarddialscale.setTickLabelFont(new Font("Dialog", 0, 14)); standarddialscale.setTickLabelPaint(Color.BLUE); standarddialscale.setMajorTickPaint(Color.BLUE); standarddialscale.setMinorTickPaint(Color.BLUE); dialplot.addScale(0, standarddialscale); StandardDialScale standarddialscale1 = new StandardDialScale(0.0D, 2500D, -120D, -300D, 500D, 4); standarddialscale1.setTickRadius(0.5D); standarddialscale1.setTickLabelOffset(0.14999999999999999D); standarddialscale1.setTickLabelFont(new Font("Dialog", 0, 10)); standarddialscale1.setTickLabelPaint(Color.RED); standarddialscale1.setMajorTickPaint(Color.RED); standarddialscale1.setMinorTickPaint(Color.RED); dialplot.addScale(1, standarddialscale1); dialplot.mapDatasetToScale(1, 1); org.jfree.chart.plot.dial.DialPointer.Pointer pointer = new org.jfree.chart.plot.dial.DialPointer.Pointer( 0); pointer.setFillPaint(Color.BLUE); dialplot.addPointer(pointer); org.jfree.chart.plot.dial.DialPointer.Pointer pin = new org.jfree.chart.plot.dial.DialPointer.Pointer(1); pin.setRadius(0.55000000000000004D); pin.setFillPaint(Color.RED); dialplot.addPointer(pin); DialCap dialcap = new DialCap(); dialcap.setRadius(0.10000000000000001D); dialplot.setCap(dialcap); Dimension size = parent.getBounds().getSize(); int width = parent.getWidth(); int height = parent.getHeight(); width = 200; JFreeChart jfreechart = new JFreeChart(dialplot); jfreechart.setBackgroundPaint(Color.WHITE); ChartPanel chartpanel = new ChartPanel(jfreechart); chartpanel.setPreferredSize(new Dimension(width, width)); add(chartpanel); }
From source file:com.crunchify.jsp.servlet.BarServlet.java
public JFreeChart getChart() { DefaultCategoryDataset dataset = new DefaultCategoryDataset(); dataset.addValue(15, "1", "451"); dataset.addValue(12, "1", "851"); dataset.addValue(10, "2", "362"); dataset.addValue(5, "2", "142"); JFreeChart chart = ChartFactory.createBarChart("Bar Chart Demo 3", // chart title "Category", // domain axis label "Value", // range axis label dataset, // data PlotOrientation.VERTICAL, // the plot orientation false, // include legend true, false);/*from www.j a v a 2 s. co m*/ chart.setBackgroundPaint(Color.lightGray); // get a reference to the plot for further customisation... CategoryPlot plot = chart.getCategoryPlot(); plot.setNoDataMessage("NO DATA!"); CategoryItemRenderer renderer = new CustomRenderer(new Paint[] { Color.red, Color.blue, Color.green, Color.yellow, Color.orange, Color.cyan, Color.magenta, Color.blue }); renderer.setItemLabelsVisible(true); ItemLabelPosition p = new ItemLabelPosition(ItemLabelAnchor.CENTER, TextAnchor.CENTER, TextAnchor.CENTER, 45.0); renderer.setPositiveItemLabelPosition(p); plot.setRenderer(renderer); // change the margin at the top of the range axis... ValueAxis rangeAxis = plot.getRangeAxis(); rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits()); rangeAxis.setLowerMargin(0.15); rangeAxis.setUpperMargin(0.15); return chart; }
From source file:motordrivertxrx.View.MainView.java
/** * Creates new form MainView/*from www . j av a2 s. c om*/ */ public MainView() { initComponents(); this.dataset1 = new DefaultValueDataset(10.0); this.dataset2 = new DefaultValueDataset(50.0); // get data for diagrams DialPlot plot = new DialPlot(); plot.setView(0.0, 0.0, 1.0, 1.0); plot.setDataset(0, this.dataset1); plot.setDataset(1, this.dataset2); SimpleDialFrame dialFrame = new SimpleDialFrame(); dialFrame.setBackgroundPaint(Color.lightGray); dialFrame.setForegroundPaint(Color.DARK_GRAY); plot.setDialFrame(dialFrame); /* GradientPaint gp = new GradientPaint(new Point(), new Color(255, 255, 255), new Point(), new Color(170, 170, 220)); */ GradientPaint gp = new GradientPaint(new Point(), new Color(255, 255, 255), new Point(), Color.ORANGE); DialBackground db = new DialBackground(gp); db.setGradientPaintTransformer( new StandardGradientPaintTransformer(GradientPaintTransformType.CENTER_HORIZONTAL)); plot.setBackground(db); DialTextAnnotation annotation1 = new DialTextAnnotation("Velocidad"); annotation1.setFont(new Font("Dialog", Font.BOLD, 14)); annotation1.setRadius(0.7); plot.addLayer(annotation1); DialValueIndicator dvi = new DialValueIndicator(0, "c"); dvi.setFont(new Font("Dialog", Font.PLAIN, 10)); dvi.setOutlinePaint(Color.darkGray); dvi.setRadius(0.60); dvi.setAngle(-103.0); plot.addLayer(dvi); DialValueIndicator dvi2 = new DialValueIndicator(1, "c"); dvi2.setFont(new Font("Dialog", Font.PLAIN, 10)); dvi2.setOutlinePaint(Color.red); dvi2.setRadius(0.60); dvi2.setAngle(-77.0); plot.addLayer(dvi2); StandardDialScale scale = new StandardDialScale(0, 127, -120, -300); scale.setTickRadius(0.88); scale.setTickLabelOffset(0.15); scale.setTickLabelFont(new Font("Dialog", Font.PLAIN, 14)); plot.addScale(0, scale); StandardDialScale scale2 = new StandardDialScale(0, 100, -120, -300); scale2.setTickRadius(0.50); scale2.setTickLabelOffset(0.15); scale2.setTickLabelFont(new Font("Dialog", Font.PLAIN, 10)); scale2.setMajorTickPaint(Color.red); plot.addScale(1, scale2); plot.mapDatasetToScale(1, 1); DialPointer needle2 = new DialPointer.Pin(1); needle2.setRadius(0.55); plot.addLayer(needle2); DialPointer needle = new DialPointer.Pointer(0); plot.addLayer(needle); DialCap cap = new DialCap(); cap.setRadius(0.10); plot.setCap(cap); JFreeChart chart1 = new JFreeChart(plot); chart1.setTitle("Velocidad motor"); ChartPanel cp1 = new ChartPanel(chart1); cp1.setPreferredSize(new Dimension(400, 400)); /*JPanel sliderPanel = new JPanel(new GridLayout(2, 2)); sliderPanel.add(new JLabel("Outer Needle:")); sliderPanel.add(new JLabel("Inner Needle:")); this.slider1 = new JSlider(-40, 60); this.slider1.setMajorTickSpacing(20); this.slider1.setPaintTicks(true); this.slider1.setPaintLabels(true); this.slider1.addChangeListener(this); sliderPanel.add(this.slider1); sliderPanel.add(this.slider1); this.slider2 = new JSlider(0, 100); this.slider2.setMajorTickSpacing(20); this.slider2.setPaintTicks(true); this.slider2.setPaintLabels(true); this.slider2.addChangeListener(this); sliderPanel.add(this.slider2);*/ velocimetroPanel.add(cp1); }
From source file:temp1.RealTimeChart.java
public static JFreeChart createChart(String chartContent, String title, String yaxisName) { thread1 = new Thread(); timeseries1 = new TimeSeries(chartContent, Millisecond.class); timeseries2 = new TimeSeries(chartContent, Millisecond.class); timeseries3 = new TimeSeries(chartContent, Millisecond.class); timeseries4 = new TimeSeries(chartContent, Millisecond.class); TimeSeriesCollection timeseriescollection = new TimeSeriesCollection(timeseries1); TimeSeriesCollection timeseriescollection1 = new TimeSeriesCollection(timeseries2); TimeSeriesCollection timeseriescollection2 = new TimeSeriesCollection(timeseries3); TimeSeriesCollection timeseriescollection3 = new TimeSeriesCollection(timeseries4); jfreechart = ChartFactory.createTimeSeriesChart("", "", "", timeseriescollection, false, false, false); final XYPlot xyplot = jfreechart.getXYPlot(); xyplot.setOutlinePaint(Color.magenta); xyplot.setBackgroundPaint(Color.lightGray); xyplot.setRangeGridlinePaint(Color.gray); xyplot.setDatasetRenderingOrder(DatasetRenderingOrder.FORWARD); ValueAxis valueaxis = xyplot.getDomainAxis(); valueaxis.setAutoRange(true);// w ww . j a va2 s . co m valueaxis.setFixedAutoRange(20000D); //Value valueaxis = xyplot.getRangeAxis(); valueaxis.setRange(800D, 3300D); xyplot.setDataset(0, timeseriescollection); xyplot.setDataset(1, timeseriescollection1); xyplot.setDataset(2, timeseriescollection2); xyplot.setDataset(3, timeseriescollection3); XYLineAndShapeRenderer xylineandshaperenderer0 = new XYLineAndShapeRenderer(); XYLineAndShapeRenderer xylineandshaperenderer1 = new XYLineAndShapeRenderer(); XYLineAndShapeRenderer xylineandshaperenderer2 = new XYLineAndShapeRenderer(); XYLineAndShapeRenderer xylineandshaperenderer3 = new XYLineAndShapeRenderer(); xylineandshaperenderer0.setBaseShapesVisible(false); xylineandshaperenderer1.setBaseShapesVisible(false); xylineandshaperenderer2.setBaseShapesVisible(false); xylineandshaperenderer3.setBaseShapesVisible(false); xylineandshaperenderer0.setSeriesPaint(0, Color.RED); xylineandshaperenderer1.setSeriesPaint(0, Color.cyan); xylineandshaperenderer2.setSeriesPaint(0, Color.yellow); xylineandshaperenderer3.setSeriesPaint(0, Color.blue); xyplot.setRenderer(0, xylineandshaperenderer0); xyplot.setRenderer(1, xylineandshaperenderer1); xyplot.setRenderer(2, xylineandshaperenderer2); xyplot.setRenderer(3, xylineandshaperenderer3); //xylineandshaperenderer.setSeriesStroke(0, new BasicStroke(0.5F, 1, 1, 5F, new float[] { 5F, 10F }, 0.0F)); return jfreechart; }
From source file:io.sanfran.wikiTrends.extraction.plots.PlotTimeSeries.java
private static JFreeChart createChart(XYDataset dataset, String title) { JFreeChart chart = ChartFactory.createTimeSeriesChart(title, // title "Date", // x-axis label "Page visits", // y-axis label dataset, // data true, // create legend? true, // generate tooltips? false // generate URLs? );/*from w ww . j a v a 2s . c o m*/ chart.setBackgroundPaint(Color.white); XYPlot plot = (XYPlot) chart.getPlot(); plot.setBackgroundPaint(Color.lightGray); plot.setDomainGridlinePaint(Color.white); plot.setRangeGridlinePaint(Color.white); plot.setAxisOffset(new RectangleInsets(5.0, 5.0, 5.0, 5.0)); plot.setDomainCrosshairVisible(true); plot.setRangeCrosshairVisible(true); XYItemRenderer r = plot.getRenderer(); if (r instanceof XYLineAndShapeRenderer) { XYLineAndShapeRenderer renderer = (XYLineAndShapeRenderer) r; renderer.setBaseShapesVisible(false); // if you want visible dots -> true renderer.setBaseShapesFilled(false); // if you want visible dots -> true if (seriesWidth != null) { for (int i = 0; i < seriesWidth.size(); i++) { renderer.setSeriesStroke(i, new BasicStroke(seriesWidth.get(i))); } } if (seriesColor != null) { for (int i = 0; i < seriesColor.size(); i++) { renderer.setSeriesPaint(i, seriesColor.get(i)); } } } DateAxis axis = (DateAxis) plot.getDomainAxis(); //axis.setDateFormatOverride(new SimpleDateFormat("MMM-yyyy")); axis.setDateFormatOverride(new SimpleDateFormat("dd-MM-yyyy")); return chart; }
From source file:MainClass.java
public MainClass() { super("Row Header Test"); setSize(300, 200);/* w w w . ja v a 2 s . co m*/ setDefaultCloseOperation(EXIT_ON_CLOSE); TableModel tm = new AbstractTableModel() { String data[] = { "", "a", "b", "c", "d", "e" }; String headers[] = { "Row #", "Column 1", "Column 2", "Column 3", "Column 4", "Column 5" }; public int getColumnCount() { return data.length; } public int getRowCount() { return 1000; } public String getColumnName(int col) { return headers[col]; } public Object getValueAt(int row, int col) { return data[col] + row; } }; TableColumnModel cm = new DefaultTableColumnModel() { boolean first = true; public void addColumn(TableColumn tc) { if (first) { first = false; return; } tc.setMinWidth(150); super.addColumn(tc); } }; TableColumnModel rowHeaderModel = new DefaultTableColumnModel() { boolean first = true; public void addColumn(TableColumn tc) { if (first) { tc.setMaxWidth(tc.getPreferredWidth()); super.addColumn(tc); first = false; } } }; JTable jt = new JTable(tm, cm); JTable headerColumn = new JTable(tm, rowHeaderModel); jt.createDefaultColumnsFromModel(); headerColumn.createDefaultColumnsFromModel(); jt.setSelectionModel(headerColumn.getSelectionModel()); headerColumn.setBackground(Color.lightGray); headerColumn.setColumnSelectionAllowed(false); headerColumn.setCellSelectionEnabled(false); JViewport jv = new JViewport(); jv.setView(headerColumn); jv.setPreferredSize(headerColumn.getMaximumSize()); jt.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); JScrollPane jsp = new JScrollPane(jt); jsp.setRowHeader(jv); jsp.setCorner(ScrollPaneConstants.UPPER_LEFT_CORNER, headerColumn.getTableHeader()); getContentPane().add(jsp, BorderLayout.CENTER); }
From source file:ws.moor.bt.gui.charts.TotalBlocksPerPeer.java
private JFreeChart createChart() { JFreeChart chart = ChartFactory.createStackedBarChart("Top 20 Block Peers", "Remote IP", "Blocks", createDataset(), PlotOrientation.VERTICAL, true, false, false); chart.setBackgroundPaint(Color.white); CategoryPlot plot = chart.getCategoryPlot(); plot.setBackgroundPaint(Color.lightGray); plot.setDomainGridlinePaint(Color.white); plot.setRangeGridlinePaint(Color.white); CategoryAxis domainAxis = plot.getDomainAxis(); domainAxis.setCategoryLabelPositions(CategoryLabelPositions.createUpRotationLabelPositions(Math.PI / 2.0)); return chart; }
From source file:edu.cuny.cat.ui.ChargePlotPanel.java
public ChargePlotPanel() { registry = GameController.getInstance().getRegistry(); setTitledBorder("Charges"); dataset = new DefaultCategoryDataset(); final JFreeChart chart = ChartFactory.createBarChart("", "", "", dataset, PlotOrientation.HORIZONTAL, true, true, false);//from w ww . j a va 2s . c om // chart.setAntiAlias(false); chart.setBackgroundPaint(getBackground()); categoryplot = (CategoryPlot) chart.getPlot(); categoryplot.setBackgroundPaint(Color.lightGray); categoryplot.setRangeGridlinePaint(Color.white); final BarRenderer barrenderer = (BarRenderer) categoryplot.getRenderer(); UIUtils.setDefaultBarRendererStyle(barrenderer); barrenderer.setLegendItemToolTipGenerator(new StandardCategorySeriesLabelGenerator("Tooltip: {0}")); categoryplot.setRowRenderingOrder(SortOrder.DESCENDING); final ChartPanel chartPanel = new ChartPanel(chart); add(chartPanel, BorderLayout.CENTER); }
From source file:scheduler.benchmarker.manager.CreateSimpleSplineChart.java
public ChartPanel createChartPanel() { XYDataset dataset = createDataset(); NumberAxis numberaxis = new NumberAxis("EMAILS"); numberaxis.setAutoRangeIncludesZero(true); numberaxis.setRange(0, dataset.getItemCount(1)); numberaxis.setVisible(false);/*from w ww . ja v a 2 s . co m*/ NumberAxis numberaxis1 = new NumberAxis("TIME CONSUMED"); numberaxis1.setAutoRangeIncludesZero(false); XYSplineRenderer xysplinerenderer = new XYSplineRenderer(); XYPlot xyplot = new XYPlot(dataset, numberaxis, numberaxis1, xysplinerenderer); xyplot.setBackgroundPaint(Color.lightGray); xyplot.setDomainGridlinePaint(Color.white); xyplot.setRangeGridlinePaint(Color.white); //xyplot.setAxisOffset(new RectangleInsets(4D, 4D, 4D, 4D)); JFreeChart jfreechart = new JFreeChart("PLAN VALUES FOR '" + sName + "' SCHEDULER", new Font(Font.SANS_SERIF, Font.PLAIN, 11), xyplot, true); chartPanel = new ChartPanel(jfreechart, true); //Creating listener chartPanel.addChartMouseListener(new ChartMouseListener() { @Override public void chartMouseClicked(ChartMouseEvent e) { ChartEntity entity = e.getEntity(); if (entity != null && (entity instanceof XYItemEntity)) { XYItemEntity item = (XYItemEntity) entity; String chartTitle = "RULE ARRANGEMENT INFORMATION FOR EMAIL \"" + dataSource.get(item.getItem()).getEmailName() + "\""; createSubChart( new CreateStackedBarChart3D(dataSource.get(item.getItem()), pluginColor, chartTitle) .createChartPanel()); } } @Override public void chartMouseMoved(ChartMouseEvent e) { //DO NOTHING } }); return chartPanel; }
From source file:DashboardInterface.CableOutSpeedDial.java
public CableOutSpeedDial(JPanel parentIn) { super(new BorderLayout()); parent = parentIn;//w w w . j a va2 s . co m dataset1 = new DefaultValueDataset(0D); dataset2 = new DefaultValueDataset(0D); pipe = MessagePipeline.getInstance(); pipe.attach(this); DialPlot dialplot = new DialPlot(); dialplot.setView(0.0D, 0.0D, 1.0D, 1.0D); dialplot.setDataset(0, dataset1); dialplot.setDataset(1, dataset2); setBackground(Color.WHITE); StandardDialFrame standarddialframe = new StandardDialFrame(); standarddialframe.setBackgroundPaint(Color.lightGray); standarddialframe.setForegroundPaint(Color.darkGray); dialplot.setDialFrame(standarddialframe); DialBackground dialbackground = new DialBackground(Color.LIGHT_GRAY); dialbackground.setGradientPaintTransformer( new StandardGradientPaintTransformer(GradientPaintTransformType.VERTICAL)); dialplot.setBackground(dialbackground); DialTextAnnotation dialtextannotation = new DialTextAnnotation("Cable Out (ft)"); dialtextannotation.setFont(new Font("Dialog", 1, 12)); dialtextannotation.setPaint(new Color(36, 130, 9)); dialtextannotation.setRadius(0.47999999999999996D); dialplot.addLayer(dialtextannotation); DialTextAnnotation dialtextannotation2 = new DialTextAnnotation("Speed (kts)"); dialtextannotation2.setFont(new Font("Dialog", 1, 12)); dialtextannotation2.setPaint(Color.BLUE); dialtextannotation2.setRadius(0.78999999999999996D); dialplot.addLayer(dialtextannotation2); /*DialValueIndicator dialvalueindicator = new DialValueIndicator(0); dialvalueindicator.setFont(new Font("Dialog", 0, 10)); dialvalueindicator.setOutlinePaint(Color.BLACK); dialvalueindicator.setRadius(0.84999999999999998D); dialvalueindicator.setAngle(-90D); dialplot.addLayer(dialvalueindicator); DialValueIndicator dialvalueindicator1 = new DialValueIndicator(1); dialvalueindicator1.setFont(new Font("Dialog", 0, 10)); dialvalueindicator1.setOutlinePaint(Color.BLACK); dialvalueindicator1.setRadius(0.60999999999999998D); dialvalueindicator1.setAngle(-90D); dialplot.addLayer(dialvalueindicator1);*/ StandardDialScale standarddialscale = new StandardDialScale(0D, 90D, -110D, -320D, 10D, 4); standarddialscale.setTickRadius(0.88D); standarddialscale.setTickLabelOffset(0.14999999999999999D); standarddialscale.setTickLabelFont(new Font("Dialog", 0, 14)); standarddialscale.setMajorTickPaint(Color.BLUE); standarddialscale.setMinorTickPaint(Color.BLUE); dialplot.addScale(0, standarddialscale); StandardDialScale standarddialscale1 = new StandardDialScale(0.0D, 6000D, -110D, -320D, 750D, 4); standarddialscale1.setTickRadius(0.5D); standarddialscale1.setTickLabelOffset(0.14999999999999999D); standarddialscale1.setTickLabelFont(new Font("Dialog", 0, 10)); standarddialscale1.setTickLabelPaint(new Color(36, 130, 9)); standarddialscale1.setMajorTickPaint(new Color(36, 130, 9)); standarddialscale1.setMinorTickPaint(new Color(36, 130, 9)); dialplot.addScale(1, standarddialscale1); dialplot.mapDatasetToScale(1, 1); org.jfree.chart.plot.dial.DialPointer.Pointer pointer = new org.jfree.chart.plot.dial.DialPointer.Pointer( 0); pointer.setFillPaint(Color.BLUE); dialplot.addPointer(pointer); org.jfree.chart.plot.dial.DialPointer.Pointer pin = new org.jfree.chart.plot.dial.DialPointer.Pointer(1); pin.setRadius(0.55000000000000004D); pin.setFillPaint(new Color(36, 130, 9)); dialplot.addPointer(pin); DialCap dialcap = new DialCap(); dialcap.setRadius(0.10000000000000001D); dialplot.setCap(dialcap); Dimension size = parent.getBounds().getSize(); int width = parent.getWidth(); int height = parent.getHeight(); width = 200; JFreeChart jfreechart = new JFreeChart(dialplot); jfreechart.setBackgroundPaint(Color.WHITE); ChartPanel chartpanel = new ChartPanel(jfreechart); chartpanel.setPreferredSize(new Dimension(width, width)); add(chartpanel); }