我试图添加一个'到每个数组值的结束和开始。原因是我有一个图形JQuery设置,并希望操纵图表值名称。如果我想让它们成为数字,我可以做得很好但是每当我尝试使用文本时,我都会收到错误,我相信这是因为没有任何错误。在我的数组值的开头和结尾。任何想法的家伙?
我得到的错误是
未捕获的ReferenceError:未定义MyTextValue
var barNames = [];
if (NoOfBars >= 1){
barNames = [name1];
}
if (NoOfBars >= 2){
barNames = [name1, name2];
}
if (NoOfBars >= 3){
barNames = [name1, name2, name3];
}
if (NoOfBars >= 4){
barNames = [name1, name2, name3, name4];
}
if (NoOfBars >= 5){
barNames = [name1, name2, name3, name4, name5];
}
if (NoOfBars >= 6){
barNames = [name1, name2, name3, name4, name5, name6];
}
if (NoOfBars >= 7){
barNames = [name1, name2, name3, name4, name5, name6, name7];
}
if (NoOfBars >= 8){
barNames = [name1, name2, name3, name4, name5, name6, name7, name8];
}
if (NoOfBars >= 9){
barNames = [name1, name2, name3, name4, name5, name6, name7, name8, name9];
}
if (NoOfBars >= 10){
barNames = [name1, name2, name3, name4, name5, name6, name7, name8, name9, name10];
}
var bar = new RGraph.Bar({
id:'cvs1',
data: barValue,
options: {
backgroundGridDashed: true,
labels: barNames,
title: 'Title of Chart',
strokestyle: 'rgba(0,0,0,0)',
textAccessible: true
}
}).draw();
答案 0 :(得分:1)
像...一样的东西。
transport :websocket, Phoenix.Transports.WebSocket,
timeout: :infinity
这实际上取决于这些值的使用方式。