List of usage examples for org.jfree.chart.axis CategoryLabelPositions createUpRotationLabelPositions
public static CategoryLabelPositions createUpRotationLabelPositions(double angle)
From source file:Reportes.ChartCustomizer.java
@Override public void customize(JFreeChart chart, ReportParameters reportParameters) { CategoryAxis domainAxis = chart.getCategoryPlot().getDomainAxis(); domainAxis.setCategoryLabelPositions(CategoryLabelPositions.createUpRotationLabelPositions(Math.PI / 2)); }
From source file:org.jfree.chart.demo.CategoryLabelPositionsDemo1.java
private static JFreeChart createChart(CategoryDataset categorydataset) { JFreeChart jfreechart = ChartFactory.createBarChart("CategoryLabelPositionsDemo1", "Category", "Value", categorydataset, PlotOrientation.VERTICAL, false, false, false); CategoryPlot categoryplot = (CategoryPlot) jfreechart.getPlot(); CategoryAxis categoryaxis = categoryplot.getDomainAxis(); categoryaxis.setMaximumCategoryLabelLines(0x7fffffff); categoryaxis.setCategoryLabelPositions( CategoryLabelPositions.createUpRotationLabelPositions(0.78539816339744828D)); return jfreechart; }
From source file:edu.esprit.pi.workshop.statistiques.BarChart.java
@Override public JFreeChart construireChart2D() { graphe = ChartFactory.createBarChart("Pourcentage revenue par Dpartement", "Departement", "Pourcentage du revenu", createDataset(), PlotOrientation.VERTICAL, true, true, true); final CategoryPlot plot = graphe.getCategoryPlot(); final CategoryAxis axis = plot.getDomainAxis(); axis.setCategoryLabelPositions(CategoryLabelPositions.createUpRotationLabelPositions(Math.PI / 2.0)); final CategoryItemRenderer renderer = plot.getRenderer(); renderer.setItemLabelsVisible(true); return graphe; }
From source file:org.neo4j.bench.chart.JFreeStackedBarChart.java
public JFreeChart render(String title, CategoryPlot plot, AbstractRenderer renderer) { plot.getDomainAxis()/*from w w w.j a va 2 s. c o m*/ .setCategoryLabelPositions(CategoryLabelPositions.createUpRotationLabelPositions(Math.PI / 4.0)); return new JFreeChart(title, plot); }
From source file:edu.esprit.pi.workshop.statistiques.BarChart.java
@Override public JFreeChart construireChart3D() { graphe = ChartFactory.createBarChart3D("Pourcentage revenue par Dpartement", "", "Pourcentage du revenu", createDataset(), PlotOrientation.HORIZONTAL, true, true, true); final CategoryPlot plot = graphe.getCategoryPlot(); final CategoryAxis axis = plot.getDomainAxis(); axis.setCategoryLabelPositions(CategoryLabelPositions.createUpRotationLabelPositions(Math.PI / 2.0)); final CategoryItemRenderer renderer = plot.getRenderer(); renderer.setItemLabelsVisible(true); return graphe; }
From source file:app.view.panel.PanelHistogramme.java
/** * Cre le graphique// w w w. j a v a2s . co m * * @param dataset Echantillon de donnes * @return Graphique */ private JFreeChart createChart(CategoryDataset dataset) { final JFreeChart chart = ChartFactory.createBarChart3D("Sries de bac", // chart title "Bacs", // domain axis label "Nombre", // range axis label dataset, // data PlotOrientation.VERTICAL, // orientation true, // include legend true, // tooltips false // urls ); final CategoryPlot plot = chart.getCategoryPlot(); final CategoryAxis axis = plot.getDomainAxis(); axis.setCategoryLabelPositions(CategoryLabelPositions.createUpRotationLabelPositions(Math.PI / 8.0)); final BarRenderer3D renderer = (BarRenderer3D) plot.getRenderer(); renderer.setDrawBarOutline(false); return chart; }
From source file:app.Histogram.java
public void histogramDesign(JFreeChart chart) { final CategoryPlot plot = chart.getCategoryPlot(); final BarRenderer renderer = (BarRenderer) plot.getRenderer(); renderer.setDrawBarOutline(false);/*from w w w .j a v a2 s. co m*/ renderer.setItemMargin(0.10); renderer.setShadowVisible(false); final GradientPaint gp0 = new GradientPaint(0.0f, 0.0f, Color.black, 0.0f, 0.0f, Color.black); final org.jfree.chart.axis.CategoryAxis domainAxis = plot.getDomainAxis(); domainAxis.setLowerMargin(0.02); domainAxis.setUpperMargin(0.02); domainAxis.setCategoryLabelPositions(CategoryLabelPositions.createUpRotationLabelPositions(1)); renderer.setSeriesPaint(0, gp0); plot.setBackgroundPaint(Color.white); plot.setRangeGridlinePaint(Color.black); plot.setRenderer(renderer); final ChartPanel chartPanel = new ChartPanel(chart); chartPanel.setPreferredSize(new java.awt.Dimension(650, 500)); JPanel panelJPanel = new JPanel(); panelJPanel.removeAll(); //panelJComboBox.removeAll(); PlotWindow hist = new PlotWindow(); hist.setVisible(true); // HistogtamWindow f = new HistogtamWindow(); // HistogtamWindow f2 = f.getInstance(); // f2.setVisible(true); // f2.getHistogramPanel().add(chartPanel); panelJPanel.add(chartPanel); hist.setContentPane(panelJPanel); }
From source file:userInterface.ManufactureRole.DecisionChartJPanel.java
private static JFreeChart createChart1(CategoryDataset categorydataset) { JFreeChart jfreechart = ChartFactory.createBarChart("Vaccine Sales", "Vaccine", "quantity", categorydataset, PlotOrientation.VERTICAL, true, true, false); CategoryPlot categoryplot = (CategoryPlot) jfreechart.getPlot(); categoryplot.setDomainGridlinesVisible(true); categoryplot.setRangeCrosshairVisible(true); categoryplot.setRangeCrosshairPaint(Color.blue); NumberAxis numberaxis = (NumberAxis) categoryplot.getRangeAxis(); numberaxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits()); BarRenderer barrenderer = (BarRenderer) categoryplot.getRenderer(); barrenderer.setDrawBarOutline(false); GradientPaint gradientpaint = new GradientPaint(0.0F, 0.0F, Color.blue, 0.0F, 0.0F, new Color(0, 0, 64)); GradientPaint gradientpaint1 = new GradientPaint(0.0F, 0.0F, Color.green, 0.0F, 0.0F, new Color(0, 64, 0)); GradientPaint gradientpaint2 = new GradientPaint(0.0F, 0.0F, Color.red, 0.0F, 0.0F, new Color(64, 0, 0)); barrenderer.setSeriesPaint(0, gradientpaint); barrenderer.setSeriesPaint(1, gradientpaint1); barrenderer.setSeriesPaint(2, gradientpaint2); barrenderer.setLegendItemToolTipGenerator(new StandardCategorySeriesLabelGenerator("Tooltip: {0}")); CategoryAxis categoryaxis = categoryplot.getDomainAxis(); categoryaxis.setCategoryLabelPositions( CategoryLabelPositions.createUpRotationLabelPositions(0.52359877559829882D)); return jfreechart; }
From source file:userInterface.StateAdminRole.DecisionChart4JPanel.java
private static JFreeChart createChart1(CategoryDataset categorydataset) { JFreeChart jfreechart = ChartFactory.createBarChart("Total Vaccinations", "Hospital", "Value", categorydataset, PlotOrientation.VERTICAL, true, true, false); CategoryPlot categoryplot = (CategoryPlot) jfreechart.getPlot(); categoryplot.setDomainGridlinesVisible(true); categoryplot.setRangeCrosshairVisible(true); categoryplot.setRangeCrosshairPaint(Color.blue); NumberAxis numberaxis = (NumberAxis) categoryplot.getRangeAxis(); numberaxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits()); BarRenderer barrenderer = (BarRenderer) categoryplot.getRenderer(); barrenderer.setDrawBarOutline(false); GradientPaint gradientpaint = new GradientPaint(0.0F, 0.0F, Color.blue, 0.0F, 0.0F, new Color(0, 0, 64)); GradientPaint gradientpaint1 = new GradientPaint(0.0F, 0.0F, Color.green, 0.0F, 0.0F, new Color(0, 64, 0)); GradientPaint gradientpaint2 = new GradientPaint(0.0F, 0.0F, Color.red, 0.0F, 0.0F, new Color(64, 0, 0)); barrenderer.setSeriesPaint(0, gradientpaint); barrenderer.setSeriesPaint(1, gradientpaint1); barrenderer.setSeriesPaint(2, gradientpaint2); barrenderer.setLegendItemToolTipGenerator(new StandardCategorySeriesLabelGenerator("Tooltip: {0}")); CategoryAxis categoryaxis = categoryplot.getDomainAxis(); categoryaxis.setCategoryLabelPositions( CategoryLabelPositions.createUpRotationLabelPositions(0.52359877559829882D)); return jfreechart; }
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; }