0

我是 jQuery 新手,我有一个小问题。我正在使用 jQplot 插件,并且我有代码:

var plotName = ['bearShevaPlot', 'haifaPlot', 'tiberiasPlot', 'kfarSabaPlot', 'netanyaPlot', 'rishonLezionPlot', 'rehovotPlot', 'telAvivPlot'];
var chartName = ['bearShevaCity', 'haifaCity', 'tiberiasCity', 'kfarSabaCity', 'netanyaCity', 'rishonLezionCity', 'rehovotCity', 'telAvivCity'];
$.each(plotName,function(a,b){
        chartName[a];
        //console.log(chartName[a] +', '+ b);
        var b = $.jqplot('/*chartName[a]*/', [haifa], {
          seriesColors: ["#FF2B00"],
          title:'',
          seriesDefaults: {showMarker:false,lineWidth:2,shadow:false},
          grid:{background:'#4C4C4C'},
          axes: {
                xaxis: {
                    min: 1,
                    max: 12,
                    tickOptions:{
                              formatString:'%.0f'
                        },
                },
         },
       });
});

现在我在评论中有chartName[a] (/ chartName[a] /) 我需要为这个数组串起字符串,但我不知道如何用它周围的'char(') 来做......

感谢您的帮助,对不起我的英语不好:)

4

1 回答 1

0

这是你想要的吗?

$.jqplot('/*'+chartName[a]+'*/', ...
于 2012-11-26T14:27:13.883 回答