I have posted a solution earlier here:
http://www.jfree.org/phpBB2/viewtopic.p ... 705#p82705
What you need to do after is to write the buffered image to a file.
Search found 26 matches
- Tue May 04, 2010 1:29 am
- Forum: JFreeChart
- Topic: Save JPanel with multiple charts as jpeg
- Replies: 1
- Views: 2765
- Fri Apr 30, 2010 8:52 pm
- Forum: JFreeChart
- Topic: Different background color depending data
- Replies: 6
- Views: 7716
Re: Different background color depending data
You can add a domain marker (in this case an IntervalMarker) to the plot and specify the layer to "Layer.BACKGROUND". addDomainMarker(Marker marker, org.jfree.ui.Layer layer) http://www.jfree.org/jfreechart/api/javadoc/org/jfree/chart/plot/XYPlot.html#addDomainMarker(org.jfree.chart.plot.Marker,%20o...
- Wed Apr 28, 2010 7:46 pm
- Forum: JFreeChart
- Topic: Zoom in horizontal axis only (Newbie questions...)
- Replies: 5
- Views: 11754
Re: Zoom in horizontal axis only (Newbie questions...)
I think you can get the bounds of the selected area. So, clone the chart, place the clone in another frame, and set the upper/lowerbounds of the axes according to the selected area.
- Wed Apr 28, 2010 7:41 pm
- Forum: JFreeChart
- Topic: Big Legend Hides Graph
- Replies: 9
- Views: 15672
Re: Big Legend Hides Graph
He was suggesting that you create your own set of colors for your chart. Then, assign one of these colors to each of the series of the plot. Since you know the color you assigned, you can create your own legend with a JPanel for example.
- Wed Apr 28, 2010 7:36 pm
- Forum: JFreeChart
- Topic: CombinedDomainXYPlot - mouse wheel zoom behavior [Fixed!!!]
- Replies: 3
- Views: 5046
Re: CombinedDomainXYPlot - mouse wheel zoom behavior [Fixed!!!]
Sorry, I don't understand what you are asking.
- Mon Apr 26, 2010 7:16 pm
- Forum: JFreeChart
- Topic: How to merge multiple mages?
- Replies: 1
- Views: 3301
Re: How to merge multiple mages?
If your ChartPanels are inside a JPanel (or other containers in Swing), then you can get a BufferedImage from it using this method: http://stackoverflow.com/questions/1349220/convert-jpanel-to-image You could also get a BufferedImage from the ChartPanel for each chart and join these images together ...
- Mon Apr 26, 2010 7:02 pm
- Forum: JFreeChart
- Topic: What is wrong with chartPanel.getScreenDataArea()?
- Replies: 3
- Views: 5572
Re: What is wrong with chartPanel.getScreenDataArea()?
How did the calculation fail? Did it return a negative number?
- Mon Apr 26, 2010 6:52 pm
- Forum: JFreeChart
- Topic: Zoom in horizontal axis only (Newbie questions...)
- Replies: 5
- Views: 11754
Re: Zoom in horizontal axis only (Newbie questions...)
You can set one axis to be zoomable and the other not zoomable with the setRangeZoomable and setDomainZoomable methods in ChartPanel: http://www.jfree.org/jfreechart/api/javadoc/org/jfree/chart/ChartPanel.html#setRangeZoomable(boolean) http://www.jfree.org/jfreechart/api/javadoc/org/jfree/chart/Char...
- Wed Apr 21, 2010 12:48 am
- Forum: JFreeChart
- Topic: How to get actual plot location on click?
- Replies: 4
- Views: 7001
Re: How to get actual plot location on click?
haha.... I thought you weren't using crosshairs... :D If you are using crosshair, then just set the the crosshair not to lock on data points for both domain and range and you will get the exact location of the point clicked. http://www.jfree.org/jfreechart/api/javadoc/org/jfree/chart/plot/XYPlot.htm...
- Tue Apr 20, 2010 8:47 pm
- Forum: JFreeChart
- Topic: How to clear unwanted chart space?
- Replies: 3
- Views: 7291
Re: How to clear unwanted chart space?
Try setting the chart's padding and/or the plot's insets.
http://www.jfree.org/jfreechart/api/jav ... gleInsets)
http://www.jfree.org/jfreechart/api/jav ... gleInsets)
http://www.jfree.org/jfreechart/api/jav ... gleInsets)
http://www.jfree.org/jfreechart/api/jav ... gleInsets)
- Tue Apr 20, 2010 8:33 pm
- Forum: JFreeChart
- Topic: How to get actual plot location on click?
- Replies: 4
- Views: 7001
Re: How to get actual plot location on click?
How did you get the nearest point?
- Fri Apr 16, 2010 11:56 pm
- Forum: JFreeChart
- Topic: create gaps in axis
- Replies: 2
- Views: 4693
Re: create gaps in axis
If your domain axis is a DateAxis, then I think you could try setting a "TimeLine" for the axis.
http://www.jfree.org/jfreechart/api/jav ... eAxis.html
http://www.jfree.org/jfreechart/api/jav ... eline.html
http://www.jfree.org/jfreechart/api/jav ... eAxis.html
http://www.jfree.org/jfreechart/api/jav ... eline.html
- Tue Apr 13, 2010 7:22 pm
- Forum: JFreeChart
- Topic: Dynamically editing chart colors
- Replies: 2
- Views: 4592
Re: Dynamically editing chart colors
It should be possible. First, try adding an additional MenuItem to the existing menu and add an ActionListener to this MenuItem. Note: The current popup menu can be accessed with the getPopupMenu() in ChartPanel class. Then, implement your method to change the colors. Finally, call this new method i...
- Tue Apr 13, 2010 1:07 am
- Forum: JFreeChart
- Topic: Label on crosshair : how to
- Replies: 2
- Views: 5502
Re: Label on crosshair : how to
I don't know whether you can have labels on crosshair, but I have a workaround for this. You could add a ChartProgressListener to your chart. In the method "chartProgress(ChartProgressEvent event)", set up code to add/remove annotations to/from the chart. Your chart would fire a ChartProgressEvent w...
- Tue Apr 13, 2010 12:53 am
- Forum: JFreeChart
- Topic: Bar Chart with months and double values only
- Replies: 1
- Views: 3803
Re: Bar Chart with months and double values only
You don't need a time series for this, just use DefaultCategoryDataset for your bar chart. Make sure you add values to the dataset in the order from Jan to Dec. It would be something like this: DefaultCategoryDataset dataset = new DefaultCategoryDataset(); dataset.addValue(1.0, "series 1", "Jan"); d...