Hi everyone! Is there anybody can help me !!!
I need to draw a histogram chart but the x-axis is the address of computer (in hexa number). So the number of bins is greater Integer.Maximum because the width of bin = 1.
I have not found the solution yet, please help me to solve this problem!!!
Thanks!
p/s: If impossible, is there any chart similar!??
Overflow the number of bins !!!
Dont use a XYChart, use a CategoryChart (Barchart) instead and do your own aggregation before you fire up the chart.
I guess you do not receive messages from all 2^32 possible IP-addresses, you might be happy if there are a million or two different addresses show up. (As most IP addresses are part of non-public networks and therefore never show up anywhere.)
After all, it is not difficult to count the number of distinct numbers. And if your data comes from a database, then a simple aggregation query should do the trick for you.
I guess you do not receive messages from all 2^32 possible IP-addresses, you might be happy if there are a million or two different addresses show up. (As most IP addresses are part of non-public networks and therefore never show up anywhere.)
After all, it is not difficult to count the number of distinct numbers. And if your data comes from a database, then a simple aggregation query should do the trick for you.
Thanks for your answer!
But i mean that address is memory address because i want to make the statistic about the number of reading and writing for every memory address in a period. So the size of address is 4 byte.
What is the maximum of bin? Integer.MAXIMUM or ...?
In my program when i set : bins = (maxAddress - minAddress), it makes my program out of memory !
Any solution?!!
Thanks and BR!
But i mean that address is memory address because i want to make the statistic about the number of reading and writing for every memory address in a period. So the size of address is 4 byte.
What is the maximum of bin? Integer.MAXIMUM or ...?
In my program when i set : bins = (maxAddress - minAddress), it makes my program out of memory !
Any solution?!!
Thanks and BR!
well, I repeat: DO NOT USE XY-Charts and do not use the out-of-the-box bining.
If you look at your data closely, you will notice that you do not access each single address between min and max. I doubt that all 2 billion internet hosts talked to your network service and therefore you are dealing with a sparsely populated distribution.
Therefore, using a "bin" for each *used* address will greatly reduce your memory consumption. However, you have to use a Categorical-Chart instead of the out-of-the-box binning provided by JFreeChart for this to work. Like all "out-of-the-box" solutions, the built- in binning assumes that your data is *NOT* sparsely populated. Out-of-the-box solutions never work for large scale data cases.
You will have to provide your own dataset *or* have to switch to a different chart type.
Just imagine how your chart looks like if each bin is one pixel wide and you have 2^32 bins. That is 2^32 pixels, which at a resolution of 72dpi gives a image with a length of 59652323.6 inch, which is about a 1,515,169.02 meters or 1,515 kilometers.
So you might have more problems than just out-of-memory here. Maybe out-of-wood exceptions if you want to print it
If you look at your data closely, you will notice that you do not access each single address between min and max. I doubt that all 2 billion internet hosts talked to your network service and therefore you are dealing with a sparsely populated distribution.
Therefore, using a "bin" for each *used* address will greatly reduce your memory consumption. However, you have to use a Categorical-Chart instead of the out-of-the-box binning provided by JFreeChart for this to work. Like all "out-of-the-box" solutions, the built- in binning assumes that your data is *NOT* sparsely populated. Out-of-the-box solutions never work for large scale data cases.
You will have to provide your own dataset *or* have to switch to a different chart type.
Just imagine how your chart looks like if each bin is one pixel wide and you have 2^32 bins. That is 2^32 pixels, which at a resolution of 72dpi gives a image with a length of 59652323.6 inch, which is about a 1,515,169.02 meters or 1,515 kilometers.
So you might have more problems than just out-of-memory here. Maybe out-of-wood exceptions if you want to print it