我第一次在Stackoverflow,並對我的壞英語感到抱歉,我要改進。 我想問你,我在我的php中顯示圖表時遇到了一些麻煩。 這裏是錯誤結果:未捕獲的SyntaxError:意外的令牌]在php
Uncaught SyntaxError: Unexpected token ]
at HTMLDivElement.<anonymous> (plugins.js:112)
at Function.each (jquery.js:374)
at jQuery.fn.init.each (jquery.js:139)
at jQuery.fn.init.$.fn.plugins (plugins.js:109)
at Object.app.init (app.js:61)
at app.js:556
at app.js:560
這裏是Inpect元素在瀏覽器中的錯誤結果的誤差源 here is
這裏是我的代碼:
echo "<div class='col-md-12'>";
echo "<div class='widget'>";
echo "<header class='widget-header'>";
echo "<h4 class='widget-title'>Chart Final Association Rule</h4>";
echo "</header>";
echo "<hr class='widget-separator'>";
echo "<div class='widget-body'>";
echo "<div data-plugin='chart' style='height:300px' data-options='{
tooltip : {
trigger: 'axis'
},
legend: {
data:['as']
},
calculable : true,
xAxis : [
{
type : 'category',
data : ['11']
}
],
yAxis : [
{
type : 'value'
}
],
series : [
{
name:'Sale',
type:'bar',
data:[2.0, 4.9, 7.0, 23.2, 25.6, 76.7, 135.6, 162.2, 32.6, 20.0, 6.4, 3.3],
markPoint : {
data : [
{type : 'max', name: 'Max'},
{type : 'min', name: 'Min'}
]
},
markLine : {
data : [
{type : 'average', name: 'Average'}
]
}
},
{
name:'Market',
type:'bar',
data:[2.6, 5.9, 9.0, 26.4, 28.7, 70.7, 175.6, 182.2, 48.7, 18.8, 6.0, 2.3],
markPoint : {
data : [
{name : 'Max', value : 182.2, xAxis: 7, yAxis: 183, symbolSize:18},
{name : 'Min', value : 2.3, xAxis: 11, yAxis: 3}
]
},
markLine : {
data : [
{type : 'average', name : 'Average'}
]
}
}
]
}'>";
echo "</div>";
echo "</div>";
echo "</div>";
echo "</div>";
我不知道該怎麼修復它,有人可以告訴我,請。 最好的方面
這是一個JavaScript錯誤,而不是PHP。顯示JS代碼。 – ishegg
與HTML元素內嵌的大型JSON結構看起來像會導致非常無效的HTML。 – David
當我在Html文件中創建我不工作,但在PHP中沒有工作 – MiyaAzhila