histogram « Development « JFreeChart Q&A





1. histogram in jfreechart    stackoverflow.com

I'm trying to use JfreeChart to create a chart for the histogram of an image , but I don't fully understand how to provide the input data for the ...

2. Dynamically building and updating Histograms with JFreeChart    stackoverflow.com

I've got a stream of incoming data that I would like to plot using a simple histogram. I don't know the range of values, or the proper resolution or bin width ...

3. jfreechart histogram with dates    stackoverflow.com

I want to display some dates in the X axis of a histogram chart, but i don't understand how i can do it with this code i can create a simple histogram ...

4. Can't run histogram demo    jfree.org

I can run other demos that I've tried but I can't get Histogram1Demo.java to run. I get a window with a title then an exception gets thrown. I have the latest libraries and only one version of libs in my path. Here is my runtime error trace. Thanks for any help! apple.awt.EventQueueExceptionHandler Caught Throwable : java.lang.NullPointerException java.lang.NullPointerException at org.jfree.chart.labels.StandardXYSeriesLabelGenerator.createItemArray(StandardXYSeriesLabelGenerator.java:118) at org.jfree.chart.labels.StandardXYSeriesLabelGenerator.generateLabel(StandardXYSeriesLabelGenerator.java:101) ...

5. Dynamic Histogram    jfree.org

6. Histogram Demo NullPointerException    jfree.org

I have just purchased the Documentation and the Demo source code. Upon compiling and executing the HistogramDemo1.java program (against the 1.0.0-rc1 jar files), I receive the following error: java.lang.NullPointerException at org.jfree.chart.labels.StandardXYSeriesLabelGenerator.createItemArray(StandardXYSeriesLabelGenerator.java:118) at org.jfree.chart.labels.StandardXYSeriesLabelGenerator.generateLabel(StandardXYSeriesLabelGenerator.java:101) at org.jfree.chart.renderer.xy.XYBarRenderer.getLegendItem(XYBarRenderer.java:389) at org.jfree.chart.plot.XYPlot.getLegendItems(XYPlot.java:3624) at org.jfree.chart.title.LegendTitle.fetchLegendItems(LegendTitle.java:348) at org.jfree.chart.title.LegendTitle.arrange(LegendTitle.java:417) at org.jfree.chart.JFreeChart.drawTitle(JFreeChart.java:1155) at org.jfree.chart.JFreeChart.draw(JFreeChart.java:1038) at org.jfree.chart.ChartPanel.paintComponent(ChartPanel.java:1271) at javax.swing.JComponent.paint(Unknown Source) at javax.swing.JComponent.paintChildren(Unknown Source) at javax.swing.JComponent.paint(Unknown Source) at javax.swing.JLayeredPane.paint(Unknown Source) at javax.swing.JComponent.paintChildren(Unknown ...

7. Histogram - inverted domain    jfree.org

I have successfully created a histogram, however, I'm having some trouble when inverting the domain axis. I use the following code to invert the axis. XYPlot plot = chart.getXYPlot(); ValueAxis valueAxis = plot.getDomainAxis(); valueAxis.setInverted(true); plot.setDomainAxis(valueAxis); However, the resulting histogram has the bars shifted to the right be one category. For example, I'm plotting categories of data in buckets of -1..-10 , ...

8. Can Histogram be updated after it is created?    jfree.org

Hi all, I am trying to update the histogram when the user wants it to be recomputed. However, the HistogramDataset class does not appear to have any sort of clear() function. I can only addSeries(). What is the correct way to update a set of data such that the histogram will be recomputed? BTW, one of the reasons for updating is ...

9. Problem in generating Histogram Chart    jfree.org

hi, i m using HistogramDemo1.class file which is given in the demo for creating histogram chart, but its giving me error like java.lang.NullPointerException at org.jfree.chart.labels.StandardXYSeriesLabelGenerator.createItemArray(StandardXYSeriesLabelGenerator.java:118) at org.jfree.chart.labels.StandardXYSeriesLabelGenerator.generateLabel(StandardXYSeriesLabelGenerator.java:101) at org.jfree.chart.renderer.xy.XYBarRenderer.getLegendItem(XYBarRenderer.java:389) at org.jfree.chart.plot.XYPlot.getLegendItems(XYPlot.java:3624) at org.jfree.chart.title.LegendTitle.fetchLegendItems(LegendTitle.java:348) at org.jfree.chart.title.LegendTitle.arrange(LegendTitle.java:417) at org.jfree.chart.JFreeChart.drawTitle(JFreeChart.java:1155) at org.jfree.chart.JFreeChart.draw(JFreeChart.java:1038) at org.jfree.chart.ChartPanel.paintComponent(ChartPanel.java:1271) at javax.swing.JComponent.paint(JComponent.java:804) at javax.swing.JComponent.paintChildren(JComponent.java:643) at javax.swing.JComponent.paint(JComponent.java:813) at javax.swing.JLayeredPane.paint(JLayeredPane.java:552) at javax.swing.JComponent.paintChildren(JComponent.java:643) at javax.swing.JComponent.paintWithOffscreenBuffer(JComponent.java:4742) at javax.swing.JComponent.paintDoubleBuffered(JComponent.java:4688) at javax.swing.JComponent.paint(JComponent.java:794) at java.awt.GraphicsCallback$PaintCallback.run(GraphicsCallback.java:21) at sun.awt.SunGraphicsCallback.runOneComponent(SunGraphicsCallback.java:60) ...





10. How do i set y-values in histogram chart + urgent    jfree.org

One way would be something like this: Code: Select all SimpleHistogramDataset dataset = new SimpleHistogramDataset("Series 1"); SimpleHistogramBin bin1 = new SimpleHistogramBin(0.0, 1.0, true, false); SimpleHistogramBin bin2 = new SimpleHistogramBin(1.0, 2.0, true, false); ...

13. Dynamic Histogram questions    jfree.org

Dynamic Histogram questions A free public discussion forum for the JFreeChart class library. Post a reply 2 posts Page 1 of 1 Dynamic Histogram questions by jervo Tue Jun 27, 2006 4:21 pm I'm trying to build a dynamic Histogram. Looking at previous messages (http://www.jfree.org/phpBB2/viewtopic.php?t=14168&highlight=dynamic+histogram http://www.jfree.org/phpBB2/viewtopic.php?t=708&highlight=dynamic+histogram) this doesn't appear to exist, so I'm working on building my own. The ...

14. Histograms    jfree.org

15. Histogram question    jfree.org

Hi all, I would like to create a chart (histogram?) with a predefined number of bins on the x axis (each of them should count the number of element which fall into a known interval), while the y axis should count the number of values falling into each bin. The last bin should count also all values bigger than #bins * ...

16. Histogram with data table    jfree.org

Is there any means in JFreeChart (or via a mod/patch) create a histogram with a data table? I unfortunately do not have the ability to provide an example image at this time, but an example can easily made using Excel. Create a chart using the "Chart Wizard" and select a "column" type chart. Skipping to step 3 ("Chart Options"), uncheck "Show ...





17. Histogram with overflow bin    jfree.org

18. trend line on histogram    jfree.org

I've created a histogram chart using ChartFactory.createHistogram which is an XYPlot using an XYBarRenderer. The chart draws correctly with a series of side by side bars. I need to add a trend line which is a line which will represent a value related to the bars. Is there a way to do it with histogram/XYPlot implementation or do I need to ...

19. number of items per bin in histogram    jfree.org

These are the steps I took: - Determine the number of bins which would be needed. It turns out this is a statisitical thing out of a text book. - Add all the non-trend line values to the chart - determine the cumulative trend line points - find out the interval in which these points gets plotted (xMax-xMin)/# of bins (known ...

20. Histogram Axes reversed    jfree.org

Histogram Axes reversed by jmarotta Thu Feb 01, 2007 11:30 pm Hi All, I'm sure this is a simple question (and may not even be a JFreeChart issue), but, in the following code, my histograms' axes appear to be reversed? Does anyone know what's happening or how to fix it? I appreciate any ideas. Thanks! Code: Select all private BufferedImage[] ...

21. Dynamic background to histogram: possible?    jfree.org

Hi, If it is required to have a different backgound for chart which is not an image of fixed size, what is the best approach? Using an extended ChartPanel type or some renderer? This back ground is changing according to x-values for example, week-ends shown in the backgound in diffrent color will change as per a date range selected etc. Note: ...

22. Normal curve on a histogram    jfree.org

23. Histogram: Retrieving the Bin count    jfree.org

Hi, I have created a stacked histogram using the HistogramDataset. I have a requirement where I need the bin count even when the Histogram Type is set to RELATIVE FREQUENCY. IS there a way I can do this, other than resetting the HistogramType to FREQUENCY? I need this to generate a Cumulative Percentage line. Regards, Priya

25. Histogram problem    jfree.org

Hello guys, I have a weird problem going on with Histograms. I am basically creating a histogram with the 100 x-axis values (or bins) which are (0.02, 0.04, 0.06 .... 1.96, 1.98, 2.0). So, the first bin is 0.02 - 0.0399, 2nd bin is 0.04 - 0.0599 and so on... There are count values for each of this bins ... for ...

26. Histogram bins    jfree.org

Hello, I was wondering if there was a way to change the size of histogram bins currently implemented. I am using a graph with two series, and I want them both to have bins with identical widths even if the number of bins is not common. The program is dynamic and so a discrete number of bins is not desirable. Thanks, ...

28. Problem in displaying Histogram chart in webpage    jfree.org

Hi, I have used the following code for displaying Histogram chart in web page. JFreeChart jfreechart = ChartFactory.createHistogram("Histogram Chart", "Measurement", "Ohms", intervalxydataset , PlotOrientation.VERTICAL, true, false, false); . . . ChartRenderingInfo info = null; response.setContentType("text/html"); info = new ChartRenderingInfo(new StandardEntityCollection()); BufferedImage chartImage = jfreechart.createBufferedImage(800, 400, info); session.setAttribute("chartImage", chartImage); I am getting NullPointerException as below.. java.lang.NullPointerException at org.jfree.chart.labels.StandardXYSeriesLabelGenerator.createItemArray(StandardXYSeriesLabelGenerator.java:118) at org.jfree.chart.labels.StandardXYSeriesLabelGenerator.generateLabel(StandardXYSeriesLabelGenerator.java:101) at org.jfree.chart.renderer.xy.XYBarRenderer.getLegendItem(XYBarRenderer.java:389) ...

29. Histogram bins scaled when drawn in chart??    jfree.org

Hi, I'm trying to make a simple histogram but for some reason all the bin sizes appear to be scaled by a factor of 5? I create the histogram bins and set their sizes manually (which works because I've printed out the bin sizes after adding to SimpleHistogramDataset). But for some reason when I create a chart using ChartFactory.createHistogram() the bin ...

30. Construct histogram    jfree.org

31. Help with Histograms alignment!    jfree.org

I've used the chart generator to generate a histogram but its alignment is all wrong. say if at x=0, y=9 and somewhere further down, x = 6, y=3, the left side of a y=9 bar starts off having at 0 with width more than 0.5 (and the scale goes up by 0.5 both x and y) , this keeps going off ...

32. Question about histograms    jfree.org

34. spacing 2D histogram    jfree.org

spacing 2D histogram by ichigo04 Tue May 06, 2008 10:46 am hello, this is still dummy tests for serious work, in fact I would like to group the bars that belong to the same series that is to say that there is no separation between bars which are the same series and keep the space there with the other series. ...

35. How to create an Histogram in this format? Plz help me    jfree.org

X axis ->has values 2,4,6,8 Y axis ->has values 1000,800,500,300 for two sets of components say for person A and person B. to be more specific, person A and person B at xaxis value 2 have an yaxis value 1000 person A and person B at xaxis value 4 have an yaxis value 800. When i try to add two dataseries ...

36. Histogram Question    jfree.org

I am working with a rather large set of data (100 million records) stored in a highly custom data structure. I'd like aggregate each data point into a set of buckets and pass to the charting library to generate a nice, graphical histogram. The problem is that the current library seems to require that the data be passed in in a ...

37. Updating a Histogram?    jfree.org

Hi, I am plotting a simple Histogram, and what I would like to do is to update the graph as new data is obtained. The updates are never frequent, and so there's no need for any flashy, super-fast dynamic stuff. At the moment I'm creating a dataset.... Code: Select all public IntervalXYDataset makeIntervalXYDataset() { ...

38. Transparency & Percentage Scaling in a Histogram    jfree.org

Well the color is not so bad, u'd play a little bit with the exadecimal value.. when u overlap too much series usually the image loss of visibility. May be that u must assign a specific color for each value, that do not create broblem if overlapped. For the tick values on the Y axis, i have read something here on ...

39. How to put a Trendline on a Histogram ?    jfree.org

I m doing histograms by using the following code SimpleHistogramDataset dataset = new SimpleHistogramDataset("Series 1"); SimpleHistogramBin bin1 = new SimpleHistogramBin(5.2756, 10.2756, true, false); SimpleHistogramBin bin2 = new SimpleHistogramBin(10.2756, 15.2756, true, false); SimpleHistogramBin bin3 = new SimpleHistogramBin(15.2756, 20.2756, true, false); SimpleHistogramBin bin4 = new SimpleHistogramBin(20.2756, 25.2756, true, false); SimpleHistogramBin bin5 = new SimpleHistogramBin(25.2756, 30.2756, true, false); SimpleHistogramBin bin6 = new SimpleHistogramBin(30.2756, 35.2756, ...

40. Histogram    jfree.org

Actually its pretty easy. You want to use a VerticalBarChart. Set your series and category gaps to zero. Since Histograms have just one series, when you create a class which will function as your dataset, you want to make sure that you only allow one series of data. Also, your data set should also return a minimum value of 0, since ...

43. Problem with overlaying a 2D function with histogram    jfree.org

Hello, guys... I am new to JFreeChart, and i find jfreechart quite useful.. but when i try to overlay a function (say, like normal distribution) with histogram, the graph of the function does not appear but the histogram appears.. i would love to purchase the guide for jfreechart but unfortunately i am not quite capable as of now and i really ...

44. Cannot show legend for histogram    jfree.org

Hi, I am trying to create a sample histogram with the following code: HistogramDataset dataset = new HistogramDataset(); double[] values = {1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0}; HistogramBin bin = new HistogramBin(4,9); dataset.addSeries("Bar",values,(values.length)/6); JFreeChart chart = ChartFactory.createHistogram("title", null,null, dataset, PlotOrientation.HORIZONTAL, true, false, false); When I run the code, it returns a NullPointerException exception (stack trace at the ...

46. Problem creating Histogram    jfree.org

Thanks skunk for your valuable reply.But, I am unable to get the reference of domain axis.Please can you post the lines of code for that.I tried this Sorry for these type of stupid posts.I am pasting my line of codes also. HistogramDataset dataset = new HistogramDataset(); dataset.setType(HistogramType.RELATIVE_FREQUENCY); dataset.addSeries("Histogram", value, 5, 0d, 10d); String plotTitle = "Histogram"; String xaxis = "number"; String ...

47. Having trouble making a histogram    jfree.org

Having trouble making a histogram by John Chamberlain Sat Nov 06, 2010 7:06 pm Hello, I am having trouble making a histogram. I cannot get the bars to line up with the right values on the x-axis and the data is not be grouped properly. Here is a picture of my histogram: I have two main problems. One is that ...

48. Histogram with data table    jfree.org