このベースの質問でごめんなさい。jqplotは初めてで、関数から計算されたデータに基づいて棒グラフを生成するために使用したいと思います。
これで、データを保持するパラメーターができました。また、棒グラフを生成するための簡単なコードがあります。それで、誰かが私にこれらの2つの部分を一緒にリンクする方法についてのヒントを与えることができますか?
ありがとう!
コードは次のとおりです。
x_data=function(a,b,c,d)
#this is the data generated from a function and it needs to be
#sent to jqplot function, i.e., x_data=[165.33, 102.9, 89.04, 181.54, 114.92].
#In order to pass the parameter to jqplot, do I need to print it out in the HTML?
<script type='text/javascript'>
$(document).ready(function(x_data){
$.jqplot.config.enablePlugins = true;
var s1=x_data; //I need to find a way to link s1 to x_data
$.jqplot('chart1', [s1], {
seriesDefaults:{
renderer:$.jqplot.BarRenderer,
pointLabels: { show: true },
rendererOptions: {
barWidth: 3
}
}
})
})
</script>