I have a histogram like this
Here Red histogram in the front, blue in the middle and green at the behind. So the most of the green histogram not able to see. Is there any option to switch between colors when hovering mouse or any other option to see the green and blue histogram.
Here is the code
public class HistogramFrame extends JFrame {
static double[] red;
static double[] green;
static double[] blue;
public HistogramFrame(String title, double[] red, double[] green, double[] blue) {
super(title);
HistogramFrame.red = red;
HistogramFrame.green = green;
HistogramFrame.blue = blue;
JFreeChart jfreechart = ChartFactory.createHistogram("Histograms combination red,blue,green", null, null, createDataset(), PlotOrientation.VERTICAL, true, true, false);
XYPlot xyplot = (XYPlot) jfreechart.getPlot();
xyplot.setForegroundAlpha(0.85F);
XYBarRenderer xybarrenderer = (XYBarRenderer) xyplot.getRenderer();
xybarrenderer.setDrawBarOutline(false);
JPanel jpanel = new ChartPanel(jfreechart);
jpanel.setPreferredSize(new Dimension(1000, 600));
setContentPane(jpanel);
}
private static IntervalXYDataset createDataset() {
HistogramDataset histogramdataset = new HistogramDataset();
histogramdataset.addSeries("Red histogram", red, 256);
histogramdataset.addSeries("Blue histogram", blue, 256);
histogramdataset.addSeries("Green histogram", green, 256);
return histogramdataset;
}
}