jqplot円グラフを表示したいのですが、静的データで表示できませんが、データベースからの動的データで表示したいのです。そのために、データベースに接続し、データをリストにバインドしました。私の見解からそのリストを呼び出しますか?
$(document).ready(function(){
var data = [
['Heavy Industry', 12],['Retail', 9], ['Light Industry', 14],
['Out of home', 16],['Commuting', 7], ['Orientation', 9]
];
var plot1 = jQuery.jqplot ('chart1', [data],
{
seriesDefaults: {
// Make this a pie chart.
renderer: jQuery.jqplot.PieRenderer,
rendererOptions: {
// Put data labels on the pie slices.
// By default, labels show the percentage of the slice.
showDataLabels: true
}
},
legend: { show:true, location: 'e' }
}
);
});
、今、私の要件はデータベースからの同じデータを表示することであり、このデータをコントローラーのリストにバインドしました。ビューからそのリストを呼び出すにはどうすればよいですか?