I created a bar chart (and stacked bar chart) and I noticed the right click menu doesn't have an option for actually changing the bar colors. Is this possible to do?
thanks,
Jeff
Dynamically editing chart colors
Dynamically editing chart colors
Jeff Storey, Software Developer
http://jeffastorey.blogspot.com
http://jeffastorey.blogspot.com
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 in the actionperformed method of the ActionListener.
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 in the actionperformed method of the ActionListener.
Re: Dynamically editing chart colors
Thanks. That was my plan, just wanted to check if that feature is already in JFreeChart somewhere so I didn't reimplement something that was already done.
Jeff Storey, Software Developer
http://jeffastorey.blogspot.com
http://jeffastorey.blogspot.com