List of usage examples for org.jfree.chart.plot XYPlot setInsets
public void setInsets(RectangleInsets insets, boolean notify)
From source file:greenapi.ui.charts.ChartPanelSupport.java
/** * Clean the value of the chart./*from www . j a v a 2 s.c o m*/ * * @see #createChart() */ public void cleanChart() { this.chart.removeLegend(); this.chartPanel.setBorder(null); cleanLabels(); DateAxis localDateAxis = (DateAxis) ((XYPlot) this.chart.getPlot()).getDomainAxis(); localDateAxis.setTickLabelsVisible(false); localDateAxis.setTickMarksVisible(false); localDateAxis.setAxisLineVisible(false); ValueAxis localValueAxis = ((XYPlot) this.chart.getPlot()).getRangeAxis(); localValueAxis.setTickLabelsVisible(false); localValueAxis.setTickMarksVisible(false); localValueAxis.setAxisLineVisible(false); XYPlot localXYPlot = (XYPlot) this.chart.getPlot(); localXYPlot.setDomainGridlineStroke(this.defaultLineStroke); localXYPlot.setDomainGridlinesVisible(true); localXYPlot.setRangeGridlineStroke(this.defaultLineStroke); localXYPlot.setRangeGridlinesVisible(true); localXYPlot.setAxisOffset(new RectangleInsets(0.0D, 0.0D, 0.0D, 0.0D)); localXYPlot.setInsets(new RectangleInsets(0.0D, 0.0D, 0.0D, 0.0D), true); }
From source file:wattsup.jsdk.ui.ChartPanelSupport.java
/** * Clean the values of the chart.//from w w w . j a v a 2 s. c o m * * @see #createChart() */ public void cleanChart() { this.chart_.removeLegend(); this.chartPanel_.setBorder(null); cleanLabels(); DateAxis localDateAxis = (DateAxis) ((XYPlot) this.chart_.getPlot()).getDomainAxis(); localDateAxis.setTickLabelsVisible(false); localDateAxis.setTickMarksVisible(false); localDateAxis.setAxisLineVisible(false); ValueAxis localValueAxis = ((XYPlot) this.chart_.getPlot()).getRangeAxis(); localValueAxis.setTickLabelsVisible(false); localValueAxis.setTickMarksVisible(false); localValueAxis.setAxisLineVisible(false); XYPlot localXYPlot = (XYPlot) this.chart_.getPlot(); localXYPlot.setDomainGridlineStroke(this.defaultLineStroke_); localXYPlot.setDomainGridlinesVisible(true); localXYPlot.setRangeGridlineStroke(this.defaultLineStroke_); localXYPlot.setRangeGridlinesVisible(true); localXYPlot.setAxisOffset(new RectangleInsets(0.0D, 0.0D, 0.0D, 0.0D)); localXYPlot.setInsets(new RectangleInsets(0.0D, 0.0D, 0.0D, 0.0D), true); }
From source file:org.jfree.chart.plot.StackedXYPlot.java
/** * Adds a subplot with the specified weight * @param subplot the subplot (<code>null</code> not permitted). * @param weight the weight (must be >= 1). *///from w ww .ja v a 2 s .c om @Override public void add(XYPlot subplot, int weight) { Objects.requireNonNull(subplot, "subplot must not be null"); if (weight <= 0) { throw new IllegalArgumentException("weight must be >= 1."); } subplot.setParent(this); subplot.setWeight(weight); subplot.addChangeListener(this); subplot.setRangeZeroBaselineVisible(false); subplot.setInsets(new RectangleInsets(0.0, 0.0, 0.0, 0.0), false); List subplots = Collections.EMPTY_LIST; try { subplots = (List) FieldUtils.readField(this, "subplots", true); } catch (IllegalAccessException ex) { Logger.getLogger(StackedXYPlot.class.getName()).log(Level.SEVERE, ex.getMessage(), ex); } subplots.add(subplot); ValueAxis axis = getDomainAxis(); if (axis != null) { axis.configure(); } fireChangeEvent(); }