A discussion forum for JFreeChart (a 2D chart library for the Java platform).
-
iraklismath
- Posts: 4
- Joined: Tue Jan 22, 2008 10:47 am
Post
by iraklismath » Thu Jun 26, 2008 3:26 pm
Is there a way to disable a chart component in order to be displayed in grayscale, JButton.setEnabled(false) style. ?
Code: Select all
temperatureDataset = new DefaultValueDataset(new Double(-1));
JFreeChart temperatureChart = createThermoChart(temperatureDataset);
ChartPanel temperatureChartPanel = new ChartPanel(temperatureChart);
temperatureChartPanel.setPreferredSize(new Dimension(200, 175));
temperatureChartPanel.setEnforceFileExtensions(false);
weatherGraphsJPanel.add(temperatureChartPanel);
temperatureChart.setEnabled(false),temperatureChartPanel.setEnabled(false); dont do anything.
Appreciate your feedback.
Iraklis
-
prassoon
- Posts: 14
- Joined: Fri May 23, 2008 1:57 am
Post
by prassoon » Thu Jun 26, 2008 10:29 pm
If you want to block the user interaction with the chart I think you can capture the events (ChartPanel.mouseDragged etc) and do whatever you like...
-
RoyW
- Posts: 93
- Joined: Wed Apr 23, 2008 7:42 pm
-
Contact:
Post
by RoyW » Fri Jun 27, 2008 2:28 pm
iraklismath wrote:in order to be displayed in grayscale
for any JPanel, setEnabled(false) does not disable the child components.
I recently ran across this project but haven't tried it.
https://jxlayer.dev.java.net/
The answer does not come from thinking outside the box, rather the answer comes from realizing the truth; There is no Box.
my js site