Search found 47 matches

by MitchBuell
Mon Apr 13, 2009 5:17 pm
Forum: JFreeChart
Topic: Customize PopupMenu in ChartPanel
Replies: 1
Views: 4219

Re: Customize PopupMenu in ChartPanel

It's impossible to debug your code when you don't provide all of it. But all you need to do is this: JPopupMenu popup = new JPopupMenu(); popup.add(new JMenuItem("New Thing")); chartPanel.setPopupMenu(popup); This will replace the built in popup menu, so you will need to put back in the Properties, ...
by MitchBuell
Tue Apr 07, 2009 1:27 pm
Forum: JFreeChart
Topic: return image instead of chart...
Replies: 1
Views: 2335

Re: return image instead of chart...

Do you mean, you want a BufferedImage instead of a JFreeChart? If so, then look at JFreeChart.createBufferedImage(int width, int height).
by MitchBuell
Wed Apr 01, 2009 4:29 pm
Forum: JFreeChart
Topic: Get XYItemRenderer details before applied to chart?
Replies: 2
Views: 2955

Re: Get XYItemRenderer details before applied to chart?

Thanks for your help; I was able to do what I wanted fairly easily, all I had to do was: renderer.setPlot(this.mychart.getXYPlot()); This allows the XYItemRenderer to setup its DrawingSupplier which is used in the lookup methods. Paint paint = renderer.getSeriesPaint(seriesIndex); if (paint == null)...
by MitchBuell
Thu Mar 19, 2009 7:10 pm
Forum: JFreeChart
Topic: Get XYItemRenderer details before applied to chart?
Replies: 2
Views: 2955

Get XYItemRenderer details before applied to chart?

My program uses a JTable to customize the XYDatasets, Domain and Range ValueAxes, and XYItemRenderers that will be put into a new JFreeChart. It's essentially a "Create a JFreeChart Wizard". Before the chart is created I allow the user to modify the XYSeries, ValueAxes, and XYItemRenderer for the cu...
by MitchBuell
Mon Mar 16, 2009 1:38 pm
Forum: JFreeChart
Topic: Using Legend to Configure Series Shapes and Colors
Replies: 2
Views: 4842

Re: Using Legend to Configure Series Shapes and Colors

The built in chart editor is rather simple and doesn't provide this functionality at all. However, you can replace or extend the built in chart editor to add this functionality. The following code shows how to get and set a series color and shape. All that is left to implement is a user interface to...
by MitchBuell
Tue Mar 10, 2009 2:23 pm
Forum: JFreeChart
Topic: How to produce chart picture in memory instead of save it
Replies: 2
Views: 2639

Re: How to produce chart picture in memory instead of save it

The JFreeChart object has a few methods for creating a BufferedImage of itself. Here's the simplest method:

Code: Select all

JFreeChart chart = createMyChart();
BufferedImage image = chart.createBufferedImage(int width, int height)
by MitchBuell
Mon Mar 09, 2009 2:43 pm
Forum: JFreeChart
Topic: How to delete or remove a Dataset and Renderer?
Replies: 4
Views: 8217

Re: How to delete or remove a Dataset and Renderer?

For others (and Google searchers) reference: The best solution I have is to dissect the chart and keep everything in temporary variables then rebuild a new chart.
by MitchBuell
Wed Mar 04, 2009 10:27 pm
Forum: JFreeChart
Topic: Removing Chart Properties Options.
Replies: 3
Views: 3022

Re: Removing Chart Properties Options.

Having your own copy of a ChartEditor that is independent of updates to the built in ChartEditor is the only downside to my approach (that I know of). However, now that the basic framework is down, you can get clever and start replacing the My stuff back to Default stuff. The only file you needed to...
by MitchBuell
Tue Mar 03, 2009 9:34 pm
Forum: JFreeChart
Topic: Removing Chart Properties Options.
Replies: 3
Views: 3022

Re: Removing Chart Properties Options.

JFreeChart has a built in chart editor that comes up when you right click on a chart and select Properties. The current chart editor is very basic, but you can replace it with your own. See my post here on how to create your own chart editor: http://www.jfree.org/phpBB2/viewtopic.php?p=74702#74702 I...
by MitchBuell
Fri Feb 20, 2009 2:34 pm
Forum: JFreeChart
Topic: Is there any way to provide interactive editing of xy-plot
Replies: 1
Views: 2155

JFreeChart has a built in chart editor that comes up when you right click on a chart and select Properties. The current chart editor is very basic, but you can replace it with your own. See my post here on how to create your own chart editor: http://www.jfree.org/phpBB2/viewtopic.php?p=74702#74702 T...
by MitchBuell
Tue Feb 17, 2009 8:19 pm
Forum: JFreeChart
Topic: graphe and tooltip
Replies: 10
Views: 7132

You shouldn't set the tooltip text on a ChartPanel. The method setToolTipText(String) comes from Java/Swing and is meant to set a static string for a component. The ChartPanel doesn't use this, as the tooltip in a chart is not static, the tooltip changes depending on where the mouse is. If you look ...
by MitchBuell
Tue Feb 17, 2009 8:04 pm
Forum: JFreeChart
Topic: Change to the 'right-click' menu
Replies: 3
Views: 8246

Elaborating of what skunk said, there are two constructors for a ChartPanel to control what shows in the right click menu. ChartPanel(JFreeChart chart, boolean properties, boolean save, boolean print, boolean zoom, boolean tooltips) and ChartPanel(JFreeChart chart, int width, int height, int minimum...
by MitchBuell
Fri Feb 13, 2009 3:34 pm
Forum: JFreeChart
Topic: Highlight selected data point
Replies: 6
Views: 8919

snoopygee wrote:But what I really need is the method for altering the selected point's colour and shape (renderer).
That's all that is left to do with my code, and unfortunately I don't know how to do that.
by MitchBuell
Thu Feb 12, 2009 3:55 pm
Forum: JFreeChart
Topic: Highlight selected data point
Replies: 6
Views: 8919

The ChartPanel has a ChartMouseListener interface that you can implement that provides feedback about mouse moves and mouse clicks. You can create your own ChartMouseListener that is called when the mouse moves or mouse clicks. It then gets the data point you care about, and you can do whatever you ...
by MitchBuell
Mon Feb 09, 2009 9:51 pm
Forum: JFreeChart
Topic: How to delete or remove a Dataset and Renderer?
Replies: 4
Views: 8217

I am respecting the 1 to 1 relationship that JFreeChart wants, and an enforcing at least one dataset, one domain, one range, and one renderer remain. It looks like, all I literally need to do is decrement the private dataset ObjectList size.