Which of the following can JFreeChart do?
1. Draw a specific function (for example log(y) = a * log(x) + b )
2. On the same graph mark and identify some points: point A with coordinates a1, a2, point B with coordinates b1, b2, etc. Those points need to be labeled.
3. User click on any of those points and the outside caller can figure out which point it is.
4. Draw functions in log-log scale
Thx-Greg Rokita
JFreeChart capabilities
Re: JFreeChart capabilities
Greg Rokita wrote:
> Which of the following can JFreeChart do?
The best thing you can do is try it out for yourself, but I'll do my best to answer...
> 1. Draw a specific function (for example log(y) = a * log(x) + b )
JFreeChart plots data rather than functions. There is some support for sampling functions (over a fixed range) and into a dataset, but if you are looking for mathematical charts you might want to investigate PtPlot.
> 2. On the same graph mark and identify some points: point A
> with coordinates a1, a2, point B with coordinates b1, b2,
> etc. Those points need to be labeled.
There is a basic annotations framework for placing text at data points. It is basic (limited function), but could easily be extended.
> 3. User click on any of those points and the outside caller
> can figure out which point it is.
You can add a ChartMouseListener to the ChartPanel class and receive ChartMouseEvent notifications. The event contains information about the entity at the mouse point.
> 4. Draw functions in log-log scale.
There are logarithmic axes that have been worked on by other developers. There have been some bug reports about them in the past, but they have settled down now so I'm assuming these work correctly (I don't use them myself).
Regards,
Dave Gilbert
> Which of the following can JFreeChart do?
The best thing you can do is try it out for yourself, but I'll do my best to answer...
> 1. Draw a specific function (for example log(y) = a * log(x) + b )
JFreeChart plots data rather than functions. There is some support for sampling functions (over a fixed range) and into a dataset, but if you are looking for mathematical charts you might want to investigate PtPlot.
> 2. On the same graph mark and identify some points: point A
> with coordinates a1, a2, point B with coordinates b1, b2,
> etc. Those points need to be labeled.
There is a basic annotations framework for placing text at data points. It is basic (limited function), but could easily be extended.
> 3. User click on any of those points and the outside caller
> can figure out which point it is.
You can add a ChartMouseListener to the ChartPanel class and receive ChartMouseEvent notifications. The event contains information about the entity at the mouse point.
> 4. Draw functions in log-log scale.
There are logarithmic axes that have been worked on by other developers. There have been some bug reports about them in the past, but they have settled down now so I'm assuming these work correctly (I don't use them myself).
Regards,
Dave Gilbert