我正在使用 Javascript d3.js 库来绘制一些图表,这些图表使用 php 从 MySQL 数据库中获取数据。我已经使用 d3.json() 从一个“回显”一些 JSON 值的 php 文件中读取。这在我的 PC XAMPP 服务器中运行良好,但在 000webhost 免费服务器上无法运行。有人可以告诉我可能是什么问题吗?我正在使用以下方式获取 JSON 数据。
d3.json(d3/section1/section1.php, function(data) {...
php 文件正在回显以下 json 数组:
[{"spark":[1,0.2,0.3,0.5,0.1,0.4,0.8,0.3,0.2,0.7,0.6,0.9],"mes":[88],"mark":[90],"info":"Network"},{"spark":[0.1,0.3,0.2,0.5,0.1,0.4,0.2,0.3,0.2,0.7,0.6,0.5],"mes":[87],"mark":[85],"info":"ERP"},{"spark":[1,0.2,0.3,0.5,0.1,0.4,0.8,0.3,0.2,0.7,0.6,0.9],"mes":[90],"mark":[100],"info":"Data Warehouse"},{"spark":[1,0.2,0.3,0.5,0.1,0.4,0.8,0.3,0.2,0.7,0.6,0.9],"mes":[95],"mark":[90],"info":"Web Site"},{"spark":[1,0.2,0.3,0.5,0.1,0.4,0.8,0.3,0.2,0.7,0.6,0.9],"mes":[98],"mark":[88],"info":"Email"},{"spark":[1,0.2,0.3,0.5,0.1,0.4,0.8,0.3,0.2,0.7,0.6,0.9],"mes":[90],"mark":[96],"info":"HR"},{"spark":[1,0.2,0.3,0.5,0.1,0.4,0.8,0.3,0.2,0.7,0.6,0.9],"mes":[100],"mark":[92],"info":"Problem Tracking"}]