I need to add a radio button onto a graph that performs a specific action when it is selected. I have drawn the graph using jfreeChart in java. But I am unable to figure out a way to add a radio button onto that graph. Is it possible to do so? If not, is it possible to draw a line graph in swing and add radio buttons on top of it? Thanks in advance.
You should have a ChartPanel
instance to add JFreeChart
to your application. Try to set some LayoutManager
eg BoxLayout
or BorderLayout
and just add the Radio Button to the panel with proper constraints to define desired position.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.