Java Code Examples for org.jfree.chart.ChartPanel#setMinimumDrawHeight()
The following examples show how to use
org.jfree.chart.ChartPanel#setMinimumDrawHeight() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ChartLogics.java From mzmine3 with GNU General Public License v2.0 | 5 votes |
/** * Removes draw size restrictions * * @param myChart */ public static void makeChartResizable(ChartPanel myChart) { myChart.setMaximumDrawWidth(1000000000); myChart.setMinimumDrawWidth(0); myChart.setMaximumDrawHeight(1000000000); myChart.setMinimumDrawHeight(0); }
Example 2
Source File: ChartLogics.java From old-mzmine3 with GNU General Public License v2.0 | 5 votes |
/** * Removes draw size restrictions * * @param myChart */ public static void makeChartResizable(ChartPanel myChart) { myChart.setMaximumDrawWidth(1000000000); myChart.setMinimumDrawWidth(0); myChart.setMaximumDrawHeight(1000000000); myChart.setMinimumDrawHeight(0); }
Example 3
Source File: ChartLogics.java From mzmine2 with GNU General Public License v2.0 | 5 votes |
/** * Removes draw size restrictions * * @param myChart */ public static void makeChartResizable(ChartPanel myChart) { myChart.setMaximumDrawWidth(1000000000); myChart.setMinimumDrawWidth(0); myChart.setMaximumDrawHeight(1000000000); myChart.setMinimumDrawHeight(0); }
Example 4
Source File: GrammarvizChartPanel.java From grammarviz2_src with GNU General Public License v2.0 | 5 votes |
/** * Creates the chart panel, puts it on display. * */ public void resetChartPanel() { // this is the new "insert" - elastic boundaries chart panel // if (null == this.session.chartData && null != this.tsData) { paintTheChart(this.tsData); } else { paintTheChart(this.session.chartData.getOriginalTimeseries()); } // reset the border label // TitledBorder tb = (TitledBorder) this.getBorder(); tb.setTitle(LABEL_DEFAULT); // instantiate and adjust the chart panel // chartPanel = new ChartPanel(this.chart); chartPanel.setMaximumDrawHeight(this.getParent().getHeight()); chartPanel.setMaximumDrawWidth(this.getParent().getWidth()); chartPanel.setMinimumDrawWidth(0); chartPanel.setMinimumDrawHeight(0); chartPanel.setMouseWheelEnabled(true); // cleanup all the content // this.removeAll(); // put the chart on show // this.add(chartPanel); // make sure all is set // this.revalidate(); }
Example 5
Source File: PieChartTab.java From mars-sim with GNU General Public License v3.0 | 4 votes |
/** * Create a PieChart view that displays the data in a particular column. * * @param model Data source. * @param column Index of the column to collate. */ public PieChartTab(MonitorModel model, int column) { super(model, false, ImageLoader.getNewIcon(MonitorWindow.PIE_ICON)); String title = model.getName() + " - " + model.getColumnName(column); setName(title); pieModel = new TablePieDataset(model, column); chart = ChartFactory.createPieChart3D(null, pieModel, true, true, false); chart.setBackgroundPaint(getBackground()); pieModel.calculate(); // 2015-10-18 Changed to 3D pie final PiePlot3D plot = (PiePlot3D)chart.getPlot(); //plot.setCircular(false); //plot.setRadius(0.60); //plot.setSectionLabelType(PiePlot.PERCENT_LABELS); plot.setStartAngle(270); plot.setDirection(Rotation.ANTICLOCKWISE); plot.setForegroundAlpha(0.6f); //plot.setInteriorGap(0.33); pieModel.addChangeListener(plot); chartpanel = new ChartPanel(chart, true); // 2015-10-18 Added setting below to keep the aspect ratio of 8:5 // see http://www.jfree.org/forum/viewtopic.php?f=3&t=115763 // Chart will always be drawn to an off-screen buffer that is the same size as the ChartPanel, so no scaling will happen when the offscreen image is copied to the panel. chartpanel.setPreferredSize(new Dimension (800, 300)); chartpanel.setMinimumDrawWidth(0); chartpanel.setMaximumDrawWidth(Integer.MAX_VALUE); chartpanel.setMinimumDrawHeight(0); chartpanel.setMaximumDrawHeight(Integer.MAX_VALUE); JPanel fixedSizePane = new JPanel(new FlowLayout()); fixedSizePane.add(chartpanel); fixedSizePane.addComponentListener(new ComponentAdapter() { @Override public void componentResized(ComponentEvent e) { int w = fixedSizePane.getWidth(); int h = fixedSizePane.getHeight(); int size = Math.min(w, h); int newWidth = (int) (size *8D/3D); chartpanel.setPreferredSize(new Dimension(newWidth, size)); fixedSizePane.revalidate(); } }); add(fixedSizePane, BorderLayout.CENTER); // 2015-10-18 Added rotator code final Rotator rotator = new Rotator(plot); rotator.start(); //System.out.println("PieChartTab : just done calling constructor"); }
Example 6
Source File: GrammarvizRuleChartPanel.java From grammarviz2_src with GNU General Public License v2.0 | 4 votes |
/** * Create the chart for the original time series. * * @return a JFreeChart object of the chart * @throws TSException */ private void chartIntervals(ArrayList<double[]> intervals) throws Exception { // making the data // XYSeriesCollection collection = new XYSeriesCollection(); int counter = 0; for (double[] series : intervals) { collection.addSeries(toSeries(counter++, series)); } // set the renderer // XYLineAndShapeRenderer xyRenderer = new XYLineAndShapeRenderer(true, false); xyRenderer.setSeriesPaint(0, new Color(0, 0, 0)); xyRenderer.setBaseStroke(new BasicStroke(3)); // X - the time axis // NumberAxis timeAxis = new NumberAxis(); // Y axis // NumberAxis valueAxis = new NumberAxis(); // put these into collection of dots // this.plot = new XYPlot(collection, timeAxis, valueAxis, xyRenderer); // enable panning // this.plot.setDomainPannable(true); this.plot.setRangePannable(true); // finally, create the chart this.chart = new JFreeChart("", JFreeChart.DEFAULT_TITLE_FONT, plot, false); // and put it on the show ChartPanel chartPanel = new ChartPanel(this.chart); chartPanel.setMinimumDrawWidth(0); chartPanel.setMinimumDrawHeight(0); chartPanel.setMaximumDrawWidth(1920); chartPanel.setMaximumDrawHeight(1200); chartPanel.setMouseWheelEnabled(true); // cleanup all the content // this.removeAll(); // put the chart on show // this.add(chartPanel); // not sure if I need this // this.validate(); this.repaint(); }