Hello, all
I wanna put an annotation on the left-up corner of a chart, and at the same time, its value changes as the mouse moves. Let say, set the x's value to an annotation.
Another one question:
I am drawing a combinedXYPlot which contains 2 charts, I wonder whether I could add two different subtitles to the two different charts? One chart, one subtitle.
Or is there any other way to realize that?
Many Thanks.
change annotations' value dynamically
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
Re: change annotations' value dynamically
You can update the annotation text, but this won't trigger a chart repaint...however, you could do that manually by calling chart.setNotify(true).archangellin wrote:I wanna put an annotation on the left-up corner of a chart, and at the same time, its value changes as the mouse moves. Let say, set the x's value to an annotation.
Recently I was experimenting with putting some overlay items on a ChartPanel using JXLayer. That has some promise - I don't have any code available to share on this, but it is something you might want to experiment with.
A CombinedXYPlot isn't really two charts - it is one chart with two subplots. So it isn't possible to put subtitles between them. You could put an XYTextAnnotation on each subplot. Alternatively, use two separate charts in two separate ChartPanels.archangellin wrote:Another one question:
I am drawing a combinedXYPlot which contains 2 charts, I wonder whether I could add two different subtitles to the two different charts? One chart, one subtitle.
Or is there any other way to realize that?
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program