我正在尝试绘制图表,如果我手动输入数字,一切都会很好。如
chart = $.jqplot('chartContainer',
[[[0, firstActual],[.5, trajectory]],
[[0, firstGoal],[1, secondGoal],[2, thirdGoal],[3, fourthGoal],[4, fifthGoal]],
[[.5, trajectory]]], {
变量是预先定义的并且工作正常。现在如果我想做这样的事情
var test = "["+0+"," +firstActual+"], ["+.5+", "+trajectory+"]";
chart = $.jqplot('chartContainer',
[[test],
[[0, firstGoal],[1, secondGoal],[2, thirdGoal],[3, fourthGoal],[4, fifthGoal]],
[[.5, trajectory]]], {
第一行不会打印。我猜这与 test 是一个字符串有关吗?无论如何让 test 出现在 jqplot 函数中?