1

私はjqplotで作業しており、配列phpからのデータをプロットしましたが、javascriptからプロットしようとすると機能しません

これはコードphpです:

$array= array();
$array[] = 34.890;
$array[] = 25.090;

コードは次のように吸収されます。

 <script>
 $(function() {

    var array = new Array();

    <?php
        for( $i=0; $i<count($array); $i++){
           echo "\narray[$i] = '$array[$i]';"; 
         }
   ?>
   graficar(  array  );
 });
 </script>

関数graficarは次のとおりです。

function graficar( array )
{

    var plot2 = $.jqplot('lienzo',
        [
            array
        ],
        {
            seriesDefaults: {
                renderer: $.jqplot.BarRenderer,
                // Show point labels to the right ('e'ast) of each bar.
                // edgeTolerance of -15 allows labels flow outside the grid
                // up to 15 pixels.  If they flow out more than that, they
                // will be hidden.
                pointLabels: {show: true, location: 'e', edgeTolerance: -15},
                // Rotate the bar shadow as if bar is lit from top right.
                shadowAngle: 135,
                // Here's where we tell the chart it is oriented horizontally.
                rendererOptions: {
                    barDirection: 'horizontal',
                    barWidth:18
                }
            },
            axes: {
                yaxis: {
                    renderer: $.jqplot.CategoryAxisRenderer
                }
            }
        }
   );

 }

私が得る間違いは次のとおりです。

TypeError: this[r]._ticks[0] is undefined
[Break On This Error]   

 ...{href:function(a){return a.getAttribute("href")},type:function(a){return a.getAt...

グラフは次のことを示しています。

ここに画像の説明を入力

どうすれば問題を解決できますか?

タンク。

4

1 に答える 1