2012-02-06 4 views
0

linkに入力すると、入力をハードコーディングすることでグラフが生成されることが示されます。さて、男の子や女の子のような値を設定するのではなく、データベースに問い合わせて、ACTIVEステータスでリクエストの合計を取得したいと思います。私はそれを行うことができますが、ここで提供されるチャートでこれをどのようにモデル化できますか?CartesianChartModelデータベース値

答えて

0

何か? dbクエリロジックを自分で追加する必要があります...

private void createCategoryModel() { 
    categoryModel = new CartesianChartModel(); 

    ChartSeries active_chart = new ChartSeries(); 
    active_chart.setLabel("ACTIVE"); 

    int total = 250; 
    int active = 100; 
    int non_active = total - active; 

    active_chart.set("Bar_Lablel", active); 


    ChartSeries non_active_chart = new ChartSeries(); 
    non_active_chart.setLabel("NON ACTIVE "); 

    non_active_chart.set("Bar_Lablel", non_active); 


    categoryModel.addSeries(active_chart); 
    categoryModel.addSeries(non_active_chart); 
} 
関連する問題