0

http://www.jqplot.com

我的数据

<script src="/Scripts/jquery.jqplot.js" type="text/javascript"></script>
<script src="/Scripts/jqplot.barRenderer.js" type="text/javascript"></script>
<script src="/Scripts/jqplot.categoryAxisRenderer.js" type="text/javascript"></script>
<script src="/Scripts/jqplot.pointLabels.js" type="text/javascript"></script>


// categories is the data on the top of the screenshot.
// hours is the data on the bottom of screenshot

    $.jqplot('timeOffGraph', hours, {
                    seriesDefaults: {
                        renderer: $.jqplot.BarRenderer,
                        rendererOptions: { fillToZero: true },
                        pointLabels: { show: true }
                    },
                    axes: {
                        xaxis: {
                            renderer: $.jqplot.CategoryAxisRenderer,
                            ticks: categories
                        },
                        yaxis: {
                            tickOptions: { formatString: '%d' },
                            autoscale: true,
                            min: 0,
                            max: 10000
                        }
                    }
                });

我得到“DataError:没有要绘制的数据”

4

1 回答 1

3

我认为你需要把它放在另一个数组中$.jqplot('timeOffGraph', [hours], {

于 2011-07-26T20:16:40.387 回答