如何将数组附加到 Jqplot 中的图例?

How to append the array to a legend in Jqplot?

我有一个数组。我想将它附加到 Jqplot 图表中的图例标签。

var temps = [];  
temps[0] = "Ax";  
temps[1] = "Bx";  
temps[2] = "Cx";  
temps[3] = "Dx";  
 opts{  
legend: {  
renderer: $.jqplot.EnhancedLegendRenderer,  
show: true,  
showLabels: true,  
//labels: ['Ax', 'Bx', 'Cx','Dx'] - this will exactly work
labels: [temps]  //Append array .It Won't working.
},  
 }; 

您只需使用: labels: temps

temps 已经是一个数组。

试试没有 [ ]
喜欢 labels : temps