Invient chart - Adding values from DB to pie chart ?

Hi ,

 I am working with invient pie chart, I need to set the values for pie chart from DB.

                XYSeries series = new XYSeries("Browser Share");
	        LinkedHashSet<DecimalPoint> points = new LinkedHashSet<DecimalPoint>();
	        points.add(new DecimalPoint(series, "Firefox", [b]
45.0
[/b]));
	        points.add(new DecimalPoint(series, "IE", [b]
26.8
[/b]));
 In the above code I need to set the values 45.0 and 26.8 from DB (thru sql query or any).The values are in 'double' so it must be something like 

double firefox = ..........?.........  ;      //the place where I need your suggestion for getting value from DB
XYSeries series = new XYSeries("Browser Share");
LinkedHashSet<DecimalPoint> points = new LinkedHashSet<DecimalPoint>();
points.add(new DecimalPoint(series, "Firefox", [b]
firefox
[/b]));
points.add(new DecimalPoint(series, "IE", [b]
26.8
[/b]));

Please provide a suggestion.

Thank you.

Here, create a list with the items you need
names
and a double array with the values
serie
(make sure they are the same size) from your DB table, and use the following codeā€¦

XYSeries series = new XYSeries("Browser Share");
        LinkedHashSet<DecimalPoint> points = new LinkedHashSet<DecimalPoint>();
                
        for (int i=0;i<names.size();i++){
        	points.add(new DecimalPoint(series,names.get(i),serie[i]
));
        }

        series.setSeriesPoints(points);
        chart.addSeries(series);

Cheers,

Hugo