hi guys, I have been playing around for a while and still didn't get the solution. I'm trying to add the values to each bar (at the top) anyone? I am adding this code...but nothing renderer.setItemLabelsVisible(true); chart.getCategoryPlot().setRenderer(renderer); public static void constructGraph(ArrayList al) { DefaultCategoryDataset dataset = new DefaultCategoryDataset(); for (int x=0; x |
I am new to jfreechart, but I have already generated a few charts for the web app I am working on. The question I have, and I've looked everywhere for answer, is if there is a way to display the actual number on or beside the bar in a chart? I will try to come up with a way to do ... |
by Leandro Tue Aug 09, 2005 9:28 pm Hy, I'm a Brazilian and my English is very poor. I got a example for your problem. Run this code. Have fun!!! **************************************************** import java.awt.Color; import java.awt.Insets; import java.text.DecimalFormat; import org.jfree.chart.ChartColor; import org.jfree.chart.ChartFactory; import org.jfree.chart.ChartPanel; import org.jfree.chart.JFreeChart; import org.jfree.chart.axis.CategoryAxis; import org.jfree.chart.axis.CategoryLabelPositions; import org.jfree.chart.axis.NumberAxis; import org.jfree.chart.axis.NumberTickUnit; import org.jfree.chart.labels.StandardCategoryLabelGenerator; import org.jfree.chart.plot.CategoryPlot; import org.jfree.chart.plot.PlotOrientation; import ... |
|
Hi, We are trying to genearte a 3D bar chart which has negative values in the value axis.Problem we are facing is bars are getting rendered from the 0th row rather than from the base. In other words " category axis base and the bars displayed has a gap". Please tell me how to fix this, i want the bars to ... |
I have managed to make it work partialy. The only problem is that the labels are displayed inside the bar, not above it. Due to the fact that the values in the chart tend to be wide apart (0-15000), the lower values are not displayed because the bar is not high enough. Is it possible to place the labels above the ... |
|
|
Hi Does somebody know, if it is possible with jfreechart to get a continuous baseline in a bar chart when you have negative bars. It works fine when for every label a bar exists. But as soon as there is a gap the line dosen't fill it up. thanks in advance. Chris[/img] |
There does appear to be a bug introduced between 0.9.21 and 1.0.1. In Bar Chart Demo 7 I have changed one value in category 3 to be 0. Running the 0.9.21 version, we see the label '0' being displayed, whereas in 1.0.1 the label is not displayed. The screenshot below shows this. The top chart is 0.9.21, the bottom chart is ... |
ItemLabelPosition itemlabelposition = new ItemLabelPosition(ItemLabelAnchor.INSIDE12, TextAnchor.CENTER_RIGHT, TextAnchor.CENTER_RIGHT, -1.6D); barrenderer.setPositiveItemLabelPosition(itemlabelposition); ItemLabelPosition itemlabelposition1 = new ItemLabelPosition(ItemLabelAnchor.OUTSIDE12, TextAnchor.CENTER_LEFT, ... |
|
In a category dataset like {50, "First", "cat1"}, {50, "First", "cat2"}, {100, "First", "cat3"}, all datavalues show up as bars in my barchart. But when one of the datavalues is large, say {58000, "First", "cat3"}, the bars for the small values completely disappear. So it appears that the values are zero instead of 50. How do I get them to display? ... |
|
Hi all, I would like to make the following kind of bar chart: - the color of a bar is COLOR1 between 0 and VALUE - the color is changed to COLOR2 above VALUE Let's say COLOR1 is green, COLOR2 is red and VALUE is 50. Ideas about the best way to implement this? EDIT: I think I found the answer ... |
HELP... ...DISPLAY VALUES IN EACH BAR...SOMETHING CAN'T WORK by yongxin100@yahoo.com.cn Mon Oct 09, 2006 11:32 am DEAR ALL: In my project ,I want to display values upon each bar,,i coded as follow: Code: Select all renderer.setItemLabelGenerator(new StandardCategoryItemLabelGenerator()); renderer.setItemLabelFont(new Font("",Font.PLAIN,12)); renderer.setItemLabelsVisible(true); plot.setRenderer(renderer); but it is not work,no value display.... i 've try jfreechart-1.0.0 and jfreechart-1.0.0 .... please tell me why. Thank ... |
Hi, i need to include to make a bar chart which shows how different errors contribute to all the error for a particular tool . In simple words , a bar chart , having 1 bar for each tool , each bar having the magnitude of the contribution of that tool to the total number of errors , and each bar ... |
I want to use a StackedBarChar or an BarChart or any other chart with bars, and i want to see the values of each bar, not only when i use tooltip. This values should be shown inside each bar or over any bar (or elsewhere?), so that i can create a PNG-File. Is this possible? |
|
|
|
|
Hi, I just found out that I can not have duplicated item on the X axis when using a bar chart ??? If I have a DefaultCategoryDataset with these values : 90,"Global","name 1" 78,"Global","name 2" 56,"Global","name 3" 34,"Global","name 3" 12,"Global","name 4" 01,"Global","name 4" the output graphic will have these values (which is incorrect) : 90,"Global","name 1" 78,"Global","name 2" 56,"Global","name 3" 12,"Global","name ... |
|
Hi. I'm displaying the charts as an icon in a jlabel. Is there a way to get the image to display the values of the different bars as the mouse hovers over them? Code: Select all JFreeChart chart = ChartFactory.createBarChart3D ... |
double[] data = new double[9]; String []bezeichnung = new String [9]; int i=0; dataset = new DefaultCategoryDataset(); while ( tIt.hasNext() ) { tCurrent = ( Laenderbericht3EntryVO ) tIt.next(); ... |
|
|
I'm a fresh user of JFreeChart. I want to show the result of an exam, with different categories, in a chart. This for analysing the result with a standard (minimal) score. My problem: I want to display the results from each question, grouped by category, as a barchart. When passing the norm(default) value the bar must have an other color then ... |
|
|
Hi again!!! I have already find a way to do it, I don't know if it is the only one but for me it works. It's quite simple if you thought about it. The value I want to show it's in a variable called aux. double aux2=new Double(aux*100).intValue()/100.0; This way you moved the coma two positions to the right and then ... |
|
|
Hi all, I happened to encounter this problem which after searching in Google and this forum for several hours, I have not found the solution to it. I believe it could be the values on the y-axis exceeding the size of the bars. Any ideas? I thought of a solution which could be removing the left and white empty spaces of ... |
|
Hi David, I want to display the label value at the position just below the bar starts.Since in WaterfallBarRenderer,the next bar dont start from base xAxis,it start from the postion where the previous bar ends.So there is some gap between the position where the next bar starts above the xAxis.I want to display the lable at this gap above the xAxis ... |
Hello EveryOne, I am using IntervalBarRenderer renderer to display bar in the chart and setSeriesItemLabelGenerator method to display the label of bar. Code is as below: private static final String[] CATEGORIES = {"Bar1"}; double[][] lows1 = {{10}}; double[][] highs1 = {{20}}; DefaultIntervalCategoryDataset dataset = new DefaultIntervalCategoryDataset(lows1, highs1); dataset.setCategoryKeys(CATEGORIES); IntervalBarRenderer renderer = new IntervalBarRenderer(); //To display the label renderer.setSeriesItemLabelGenerator(0, new StandardCategoryItemLabelGenerator()); renderer.setSeriesItemLabelsVisible(0, ... |
|
BarPlotEntry[] sortedArray = sortCostBarplot(); BarPlotEntry costBar1 = sortedArray[0]; String costBar1Name = costBar1.getName(); int costBar1Value = costBar1.getValue(); ... ... |
Hello, I have created a bar chart, were each bar shows an average of a set of values. Now I would like to show the minimum and maximum values as small vertical lines starting up and down from the bar, thus showing the min and max values of the correspondingset. How can I achieve this? This is sometimes used in literature, ... |
|
|
|
Hi folks, I am new to JFreeCharts .. I am trying to plot a simple XY chart and I was successfully able to do the same, thanks to all the coders of JfreeChart. The range of my Y axis is too much varying from 0 to 20000 and hence I need to show the value on the top of the area ... |
DefaultCategoryDataset dataset = new DefaultCategoryDataset(); for (int r = 0; r < data.length; r++) { String rowKey = "" + (r + 1); ... |
Hi all, I'm new to JFree Chart. And I'm trying to construct one with months [jan, feb, mar, ...] as the x axis and double values (balances) for those months . the problem is that i need only months on the x- axis. i tried this : public JFreeChart createChart(String title) { TimeSeries time = new TimeSeries("Annual", "Month", "Value", Year.class); time.add(new ... |
I am trying to put together a bar chart that is made up of an amount of time for values (y-axis) and text for x-axis. I am setting the values in milliseconds. For example, I am creating, what I believe to be, a simple bar chart using: dataset.setValue(360000L, "", "A"); dataset.setValue(360000L, "", "B"); dataset.setValue(10400000L, "", "C"); dataset.setValue(10500000L, "", "D"); The chart ... |
|
|