我这里的json数据有什么问题吗?

发布于 2024-07-26 09:31:35 字数 759 浏览 8 评论 0原文

我只是使用 Open Flash Chart http://teethgrinder.co.uk 制作一个简单的图表/open-flash-chart/ 显示我网站上的访问情况。

我已经生成了以下 json 数据,但我从中得到了一个语法错误:

&title=Traffic,{font-size: 20px; color: #736AFF}&
&x_label_style=10,0x000000,0,2&
&x_axis_steps=1&
&y_legend=Number,12,#736AFF&
&y_ticks=5,10,4&
&line=2,0x9933CC,Page views,10&
&values=3,2,0,1,0,0,3,0,0,1,1,2,45,4,0,0,0,0,0,32,5,0,0,0,0,0,0,0,0,0,0&
&x_labels=30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1&
&y_min=0&
&y_max=45&

基本上我只是希望在此图表上生成一行。 数据对我来说看起来不错,但显然有些问题。

有任何想法吗?

I'm just doing a simple graph using Open Flash Chart http://teethgrinder.co.uk/open-flash-chart/ which shows the visits on my site.

I have produced the following json data but I'm getting back a syntax error from this:

&title=Traffic,{font-size: 20px; color: #736AFF}&
&x_label_style=10,0x000000,0,2&
&x_axis_steps=1&
&y_legend=Number,12,#736AFF&
&y_ticks=5,10,4&
&line=2,0x9933CC,Page views,10&
&values=3,2,0,1,0,0,3,0,0,1,1,2,45,4,0,0,0,0,0,32,5,0,0,0,0,0,0,0,0,0,0&
&x_labels=30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1&
&y_min=0&
&y_max=45&

Basically I'm just hoping to produce a single line on this graph. The data looks Okay to me but obviously something is wrong.

Any ideas?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

逆夏时光 2024-08-02 09:31:35

嗯,你确定你的粘贴没有损坏吗?

JSON 语法(基本上)是

Expression ::= Primitive | Object | Array
Primitive ::= Number | Boolean | String | null
Object ::= {} | {String : Exression (, String : Exression)*}
Array ::= [] | [Expression (, Expression)*]

例如。 您发布的 json 中的 & 等都是伪造的 - 除非我遗漏了有关您发送 JSON 的内容/方式的一些详细信息。

Um, are you sure your paste hasn't been corrupted?

The JSON grammar is (basically)

Expression ::= Primitive | Object | Array
Primitive ::= Number | Boolean | String | null
Object ::= {} | {String : Exression (, String : Exression)*}
Array ::= [] | [Expression (, Expression)*]

Eg. the &'s etc in the json that you have posted are bogus -- unless i'm missing some detail about what/how your sending the JSON.

心舞飞扬 2024-08-02 09:31:35

您使用的图表软件版本错误。

1.0 有自己的任意数据格式,就像您粘贴的那样,
2.0 有 JSON,这与您粘贴的不同。

您将在 2.0 教程中看到您的输出需要模拟的 示例 JSON 代码

如果您无法使用 1.0 [tutorial] ,那么您需要使用 1.0 格式

You're using the wrong version of the charting software.

1.0 Has its own arbitrary data format like that you pasted,
and 2.0 has JSON, which is unlike that which you pasted.

You'll see in the tutorial for 2.0 That there is an example JSON code which your output needs to emulate.

If you're stuck using 1.0 [tutorial] ,then you need to use the 1.0 format

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文