Hey,
I use Jfreechart in a RCP application and I have a problem :
I can't change the popupmenu using a chartComposite is it under development or do I use it badly ?
Here is my code (trying to remove the popupmenu) :
ChartPanel chartPanel = new ChartPanel(chart, true);
chartPanel.setPopupMenu(null);
final ChartComposite frame = new ChartComposite(parent, SWT.NONE,chartPanel.getChart(), true);
popupmenu SWT
popupmenu SWT
------------------------------
Thanks
Yoann
Thanks
Yoann
There is something wrong in your code, you do not need the ChartPanel instance :
HTH,
Henry
Code: Select all
final ChartComposite frame = new ChartComposite(parent, SWT.NONE,chart, true);
frame.setPopupMenu(null);
Henry
There is a way to change the popup menu by overriding the createPopupMenu() method in the subclass of ChartComposite.
Code: Select all
protected Menu createPopupMenu(boolean properties, boolean save, boolean print, boolean zoom) {
Menu menu = super.createPopupMenu(properties, save, print, zoom);
//Then add your menu items
MenuItem item = new MenuItem(menu, SWT.SEPARATOR);
item = new MenuItem(menu, SWT.NONE);
item.setText("Whatever");
.....
//finally return the menu
return menu;
}