当我尝试输出图表时,我得到一个空白的屏幕,
当我删除xaxis和yaxis选项时,有效...不知道该怎么做。
<script type="text/javascript">
//Chart1
var chart1Options = {
series: {
lines: { show: true },
color: "#fff",
points: { show: true }
},
valueLabels: { show: true },
grid: {
backgroundColor: { colors: ["#4ca8fa", "#2887da"] },
bordercolor: "#fff",
borderwidth: "60",
hoverable: true //IMPORTANT! this is needed for tooltip to work
},
xaxis: { mode: "time", timeformat: "%y/%m/%d", axisLabel: 'Date' },
yaxis: { axisLabel: 'Result'}
}; var dataset1 = { label: "result", data: <?php echo json_encode($dataset1); ?>,};
$.plot($("#chart1"), [ dataset1 ], chart1Options);
</script>
任何帮助表示感谢。
答案 0 :(得分:0)
嗨,在这一行附近你缺少关闭php标签。 **data: <?php echo json_encode($dataset1);**
//关闭缺失这可能会对您有所帮助。