MeterPlot Range

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
gopinath
Posts: 12
Joined: Wed Feb 17, 2010 1:21 pm
antibot: No, of course not.

MeterPlot Range

Post by gopinath » Fri Apr 16, 2010 8:39 am

Please help me in customising the maimum range for a MeterPlot. It seems to be 100 by default.

Here is my sample code

Code: Select all

MeterPlot plot = new MeterPlot(dataset);
Color c1 = new Color(255,79,100);
        Color c2 = new Color(252,252,106);
        Color c3 = new Color(79,255,132);
        plot.addInterval(new MeterInterval("Low"));
        plot.addInterval(new MeterInterval("Medium") );
        plot.addInterval(new MeterInterval("High"));
        plot.setUnits ("%");
       
        plot.setDialBackgroundPaint (Color.DARK_GRAY);
        plot.setNeedlePaint (Color.BLACK);
        plot.setShadow (false);
        plot.setDialShape (DialShape.CHORD);
        plot.setMeterAngle (180);
       
        JFreeChart chart = new JFreeChart("Meter Chart 2",
                JFreeChart.DEFAULT_TITLE_FONT, plot, false);
        chart.setBackgroundPaint (Color.WHITE);
        return chart;
Thanks,
Gopi

paradoxoff
Posts: 1634
Joined: Sat Feb 17, 2007 1:51 pm

Re: MeterPlot Range

Post by paradoxoff » Sat Apr 17, 2010 10:11 am

Code: Select all

MeterPlot.setRange(Range range)
BTW, I doubt that your code snippet will compile because the MeterInterval constructors miss a Range parameter as well.

gopinath
Posts: 12
Joined: Wed Feb 17, 2010 1:21 pm
antibot: No, of course not.

Re: MeterPlot Range

Post by gopinath » Tue Apr 20, 2010 1:28 pm

Dear paradoxoff,

Thanks for your reply. It is useful for me.
Yes the code snippet I pasted before was wrong.I have done that by mistake.

Locked