List of usage examples for org.jfree.util Rotation CLOCKWISE
Rotation CLOCKWISE
To view the source code for org.jfree.util Rotation CLOCKWISE.
Click Source Link
From source file:name.martingeisse.reporting.definition.keycount.UnboundChartBlock.java
@Override public ChartBlock bindToData(final DataSources dataSources) { // generate the dataset from the query DefaultPieDataset dataset = new DefaultPieDataset(); IKeyCountResultSet resultSet = query.bindToData(dataSources); while (resultSet.next()) { KeyCountEntry entry = resultSet.get(); dataset.setValue(entry.getKey(), entry.getCount()); }//from w ww.j a va 2s . c om resultSet.close(); // generate the chart JFreeChart chart = ChartFactory.createPieChart("My Title", dataset, true, true, false); PiePlot plot = (PiePlot) chart.getPlot(); plot.setStartAngle(290); plot.setDirection(Rotation.CLOCKWISE); plot.setForegroundAlpha(0.8f); return new ChartBlock(chart); }
From source file:org.jw.service.factory.StatisticsChartFactory.java
public static JFreeChart createPieChart3D(PieDataset dataset, String title) { JFreeChart chart = ChartFactory.createPieChart3D(title, dataset, true, true, true); PiePlot3D plot = (PiePlot3D) chart.getPlot(); plot.setForegroundAlpha(0.5f);//from w ww . j av a 2 s. co m plot.setDirection(Rotation.CLOCKWISE); return chart; }
From source file:net.sf.jasperreports.samples.jfreechart.JFreeChartScriptlet.java
/** * *///from www . j a v a2s . com public void afterReportInit() throws JRScriptletException { DefaultPieDataset dataset = new DefaultPieDataset(); dataset.setValue("Java", new Double(43.2)); dataset.setValue("Visual Basic", new Double(10.0)); dataset.setValue("C/C++", new Double(17.5)); dataset.setValue("PHP", new Double(32.5)); dataset.setValue("Perl", new Double(1.0)); JFreeChart chart = ChartFactory.createPieChart3D("Pie Chart 3D Demo 1", dataset, true, true, false); PiePlot3D plot = (PiePlot3D) chart.getPlot(); plot.setStartAngle(290); plot.setDirection(Rotation.CLOCKWISE); plot.setForegroundAlpha(0.5f); plot.setNoDataMessage("No data to display"); /* */ this.setVariableValue("Chart", new JCommonDrawableRenderer(chart)); }
From source file:cz.zcu.kiv.eegdatabase.wui.components.utils.ChartUtils.java
public static BufferedImage gererateChartForTopDownloadHistory(ChoiceHistory choiceHistory, boolean generateEmptyGraph, List<DownloadStatistic> topDownloadedFilesList, long countOfFilesHistory) { long countFile = 0; DefaultPieDataset dataset = new DefaultPieDataset(); if (!generateEmptyGraph && topDownloadedFilesList != null) { for (int i = 0; i < topDownloadedFilesList.size(); i++) { dataset.setValue(topDownloadedFilesList.get(i).getFileName(), new Long(topDownloadedFilesList.get(i).getCount())); countFile = countFile + topDownloadedFilesList.get(i).getCount(); }//from w ww .j ava 2 s . com if (countOfFilesHistory > countFile) { dataset.setValue("Other", countOfFilesHistory - countFile); } } String chartTitle = ResourceUtils.getString("title.dailyStatistic"); if (choiceHistory == ChoiceHistory.WEEKLY) { chartTitle = ResourceUtils.getString("title.weeklyStatistic"); } else if (choiceHistory == ChoiceHistory.MONTHLY) { chartTitle = ResourceUtils.getString("title.monthlyStatistic"); } JFreeChart chart = ChartFactory.createPieChart3D(chartTitle, // chart // title dataset, // data true, // include legend true, false); PiePlot3D plot = (PiePlot3D) chart.getPlot(); plot.setStartAngle(290); plot.setDirection(Rotation.CLOCKWISE); plot.setForegroundAlpha(0.5f); plot.setNoDataMessage(ResourceUtils.getString("label.noDataMessage")); return chart.createBufferedImage(600, 400); }
From source file:bzstats.chart.KillRatioChart.java
/** * @see bzstats.chart.ChartFactory#getChart() *///from w ww.j a va2 s .c o m protected JFreeChart getChart() { DefaultPieDataset dataset = new DefaultPieDataset(); Iterator playeriter = stats.getPlayerStats().values().iterator(); PlayerStats player; int playercount = 0; while (playeriter.hasNext() && (playercount++ < MAXPLAYERS)) { player = (PlayerStats) playeriter.next(); dataset.setValue(player.getName(), player.getKillRatio()); } // create chart and plot JFreeChart chart = ChartFactory.createPieChart3D("Killratio", // chart title dataset, // data false, // include legend true, false); chart.addSubtitle(new TextTitle("kills/deaths")); final PiePlot3D plot = (PiePlot3D) chart.getPlot(); plot.setStartAngle(290); plot.setDirection(Rotation.CLOCKWISE); plot.setForegroundAlpha(0.5f); plot.setBackgroundAlpha(0); plot.setNoDataMessage("No data to display"); plot.setDepthFactor(.1f); return chart; }
From source file:unikn.dbis.univis.visualization.chart.RingChart.java
/** * Makes the plot.//www . j a v a2 s.c o m */ protected void plot() { RingPlot plot = (RingPlot) getChart().getPlot(); plot.setStartAngle(290); plot.setDirection(Rotation.CLOCKWISE); plot.setForegroundAlpha(0.5f); plot.setNoDataMessage("No data available"); plot.setLabelGenerator(null); plot.setLegendLabelGenerator(new LabelGenerator(createTotal())); }
From source file:unikn.dbis.univis.visualization.chart.PieChart.java
/** * Makes the plot./*from w ww . j a v a 2s .c om*/ */ protected void plot() { PiePlot3D plot = (PiePlot3D) getChart().getPlot(); plot.setStartAngle(290); plot.setDirection(Rotation.CLOCKWISE); plot.setForegroundAlpha(0.5f); plot.setNoDataMessage("No data available"); plot.setLabelGenerator(null); plot.setLegendLabelGenerator(new LabelGenerator(createTotal())); }
From source file:gui.images.ClassifierResultPanel.java
/** * Sets the new results for display./*from ww w . ja v a2 s .c o m*/ * * @param prediction Float array corresponding to the classifier prediction. * @param classifierName String that is the classifier name. * @param classColors Color array representing the class color. * @param classNames String array representing the class names. */ public void setResults(float[] prediction, String classifierName, Color[] classColors, String[] classNames) { int numClasses = classNames.length; DefaultPieDataset pieData = new DefaultPieDataset(); for (int cIndex = 0; cIndex < numClasses; cIndex++) { pieData.setValue(classNames[cIndex], prediction[cIndex]); } JFreeChart chart = ChartFactory.createPieChart3D(classifierName + " prediction", pieData, true, true, false); PiePlot plot = (PiePlot) chart.getPlot(); plot.setDirection(Rotation.CLOCKWISE); plot.setForegroundAlpha(0.5f); PieRenderer prend = new PieRenderer(classColors); prend.setColor(plot, pieData); ChartPanel chartPanel = new ChartPanel(chart); chartPanel.setPreferredSize(new Dimension(140, 140)); resultChartPanel.removeAll(); resultChartPanel.add(chartPanel); resultChartPanel.revalidate(); resultChartPanel.repaint(); }
From source file:org.sonar.plugins.scmstats.charts.PieChart3D.java
@Override protected Plot getPlot(ChartParameters params) { PiePlot3D plot = new PiePlot3D(); String[] colorsHex = params.getValues(PARAM_COLORS, ",", true); String[] serie = params.getValues(PARAM_VALUES, ";", true); DefaultPieDataset set = new DefaultPieDataset(); Color[] colors = COLORS;/*from www .j av a 2 s . com*/ if (colorsHex != null && colorsHex.length > 0) { colors = new Color[colorsHex.length]; for (int i = 0; i < colorsHex.length; i++) { colors[i] = Color.decode("#" + colorsHex[i]); } } String[] keyValue = null; for (int i = 0; i < serie.length; i++) { if (!StringUtils.isEmpty(serie[i])) { keyValue = StringUtils.split(serie[i], "="); set.setValue(keyValue[0], Double.parseDouble(keyValue[1])); plot.setSectionPaint(keyValue[0], colors[i]); } } plot.setDataset(set); plot.setStartAngle(180); plot.setCircular(true); plot.setDirection(Rotation.CLOCKWISE); plot.setNoDataMessage(DEFAULT_MESSAGE_NODATA); plot.setInsets(RectangleInsets.ZERO_INSETS); plot.setForegroundAlpha(1.0f); plot.setBackgroundAlpha(0.0f); plot.setIgnoreNullValues(true); plot.setIgnoreZeroValues(true); plot.setOutlinePaint(Color.WHITE); plot.setShadowPaint(Color.GREEN); plot.setDarkerSides(true); plot.setLabelFont(DEFAULT_FONT); plot.setLabelPaint(Color.BLACK); plot.setLabelBackgroundPaint(Color.WHITE); plot.setLabelOutlinePaint(Color.WHITE); plot.setLabelShadowPaint(Color.GRAY); plot.setLabelPadding(new RectangleInsets(1, 1, 1, 1)); plot.setInteriorGap(0.01); plot.setMaximumLabelWidth(0.25); return plot; }
From source file:org.sonar.plugins.abacus.chart.PieChart3D.java
@Override protected Plot getPlot(ChartParameters params) { PiePlot3D plot = new PiePlot3D(); String[] colorsHex = params.getValues(PARAM_COLORS, ",", true); String[] serie = params.getValues(PARAM_VALUES, ";", true); DefaultPieDataset set = new DefaultPieDataset(); Color[] colors = COLORS;/* ww w .ja v a 2s .c o m*/ if (colorsHex != null && colorsHex.length > 0) { colors = new Color[colorsHex.length]; for (int i = 0; i < colorsHex.length; i++) { colors[i] = Color.decode("#" + colorsHex[i]); } } String[] keyValue = null; for (int i = 0; i < serie.length; i++) { if (!StringUtils.isEmpty(serie[i])) { keyValue = StringUtils.split(serie[i], "="); set.setValue(keyValue[0], Double.parseDouble(keyValue[1])); plot.setSectionPaint(keyValue[0], colors[i]); } } plot.setDataset(set); plot.setStartAngle(360); plot.setCircular(true); plot.setDirection(Rotation.CLOCKWISE); plot.setNoDataMessage(DEFAULT_MESSAGE_NODATA); plot.setInsets(RectangleInsets.ZERO_INSETS); plot.setForegroundAlpha(1.0f); plot.setBackgroundAlpha(0.0f); plot.setIgnoreNullValues(true); plot.setIgnoreZeroValues(true); plot.setOutlinePaint(Color.WHITE); plot.setShadowPaint(Color.WHITE); plot.setDarkerSides(false); plot.setLabelFont(DEFAULT_FONT); plot.setLabelPaint(Color.BLACK); plot.setLabelBackgroundPaint(Color.WHITE); plot.setLabelOutlinePaint(Color.WHITE); plot.setLabelShadowPaint(Color.WHITE); plot.setLabelPadding(new RectangleInsets(1, 1, 1, 1)); plot.setInteriorGap(0.02); plot.setMaximumLabelWidth(0.15); return plot; }