dz 的 Open Flash Chart 2 补丁错误
我正在使用修补版本(http://ofc2dz.com),因为我需要“null-gap”的功能:true。我有一个工作正常的折线图,有空值和没有空值。当我将一个 y 值更改为 null 时,图表会在顶部显示一个蓝色面板。好消息是,我有有效的 json,并且 json 的小变化破坏了图表。我希望开放式闪存图表大师能够发现我所犯的错误。我已经粘贴了下面的 json。
感谢您的任何帮助
此 JSON 有效:
{
"bg_colour": "#F4F4F4",
"title": {
"text": "title",
"style": "{font-size:20px; color:#F90F0E; font-family: Verdana; text-align: center;}"
},
"y_legend": {
"text": "Values",
"style": "{color:#F90F0E; font-size: 12px}"
},
"x_legend": {
"text": "Date",
"style": "{color:#F90F0E; font-size: 12px}"
},
"elements": [
{
"type": "line",
"colour": "#0000FF",
"width": 2,
"text": "test",
"on-show":{"type":""},
"values": [
{
"x": 1291161976,
"y": 42
},
{
"x": 1291283358,
"y": 10
},
{
"x": 1291334716,
"y": null,
"tip": ""
},
{
"x": 1291421116,
"y": null,
"tip": ""
},
{
"x": 1291507516,
"y": null,
"tip": ""
},
{
"x": 1291593910,
"y": 19
},
{
"x": 1291680310,
"y": 19
},
{
"x": 1291766710,
"y": 19
},
{
"x": 1291853117,
"y": 15
},
{
"x": 1291900196,
"y": 16
},
{
"x": 1291902293,
"y": 17
},
{
"x": 1291946711,
"y": 16
},
{
"x": 1292033116,
"y": 15
},
{
"x": 1292119510,
"y": 17
},
{
"x": 1292205917,
"y": 15
},
{
"x": 1292292315,
"y": 17
},
{
"x": 1292378717,
"y": 15
},
{
"x": 1292465117,
"y": 16
},
{
"x": 1292579504,
"y": 16
},
{
"x": 1292637910,
"y": 16
},
{
"x": 1292724316,
"y": 17
},
{
"x": 1292810716,
"y": 16
},
{
"x": 1292897116,
"y": 16
},
{
"x": 1292983510,
"y": 16
},
{
"x": 1293069915,
"y": 17
},
{
"x": 1293847515,
"y": 10
},
{
"x": 1293933916,
"y": 19
},
{
"x": 1294020316,
"y": null,
"tip": ""
},
{
"x": 1294106716,
"y": null,
"tip": ""
},
{
"x": 1294193115,
"y": null,
"tip": ""
}
]
}
],
"x_axis": {
"stroke": 2,
"tick-height": 5,
"colour": "#000000",
"grid-colour": "#777777",
"min": 1291161976,
"max": 1294193115,
"steps": 151556,
"labels": {
"text": "#date:jS M Y#",
"rotate": "90",
"steps": 151556,
"visible-steps": 1
}
},
"y_axis": {
"stroke": 2,
"tick-length": 1,
"colour": "#000000",
"grid-colour": "#777777",
"steps": 5,
"visible-steps": 5,
"min": 60,
"max": 1
}
}
此 JSON 已损坏:
{
"bg_colour": "#F4F4F4",
"title": {
"text": "title",
"style": "{font-size:20px; color:#F90F0E; font-family: Verdana; text-align: center;}"
},
"y_legend": {
"text": "value",
"style": "{color:#F90F0E; font-size: 12px}"
},
"x_legend": {
"text": "Date",
"style": "{color:#F90F0E; font-size: 12px}"
},
"elements": [
{
"type": "line",
"colour": "#0000FF",
"width": 2,
"text": "test",
"on-show":{"type":""},
"values": [
{
"x": 1291161976,
"y": 42
},
{
"x": 1291283358,
"y": 10
},
{
"x": 1291334716,
"y": null,
"tip": ""
},
{
"x": 1291421116,
"y": null,
"tip": ""
},
{
"x": 1291507516,
"y": null,
"tip": ""
},
{
"x": 1291593910,
"y": 19
},
{
"x": 1291680310,
"y": 19
},
{
"x": 1291766710,
"y": 19
},
{
"x": 1291853117,
"y": 15
},
{
"x": 1291900196,
"y": 16
},
{
"x": 1291902293,
"y": 17
},
{
"x": 1291946711,
"y": 16
},
{
"x": 1292033116,
"y": 15
},
{
"x": 1292119510,
"y": 17
},
{
"x": 1292205917,
"y": 15
},
{
"x": 1292292315,
"y": 17
},
{
"x": 1292378717,
"y": 15
},
{
"x": 1292465117,
"y": 16
},
{
"x": 1292579504,
"y": 16
},
{
"x": 1292637910,
"y": 16
},
{
"x": 1292724316,
"y": null
},
{
"x": 1292810716,
"y": 16
},
{
"x": 1292897116,
"y": 16
},
{
"x": 1292983510,
"y": 16
},
{
"x": 1293069915,
"y": 17
},
{
"x": 1293847515,
"y": 10
},
{
"x": 1293933916,
"y": 19
},
{
"x": 1294020316,
"y": null,
"tip": ""
},
{
"x": 1294106716,
"y": null,
"tip": ""
},
{
"x": 1294193115,
"y": null,
"tip": ""
}
]
}
],
"x_axis": {
"stroke": 2,
"tick-height": 5,
"colour": "#000000",
"grid-colour": "#777777",
"min": 1291161976,
"max": 1294193115,
"steps": 151556,
"labels": {
"text": "#date:jS M Y#",
"rotate": "90",
"steps": 151556,
"visible-steps": 1
}
},
"y_axis": {
"stroke": 2,
"tick-length": 1,
"colour": "#000000",
"grid-colour": "#777777",
"steps": 5,
"visible-steps": 5,
"min": 60,
"max": 1
}
}
我刚刚将 y 值之一更改为 null。这足以打破图表。
i am using the patched version(http://ofc2dz.com) because i need the functionality of "null-gap":true. i have a line graph which works fine, with null values and without. when i change one y value to null, the graph displays with a blue panel across the top. the good news is, i have the json which works, and the json with the small change which breaks the graph. i am hoping an open flash chart guru will spot the error i have made. i have pasted the json below.
thanks for any help
THIS JSON WORKS:
{
"bg_colour": "#F4F4F4",
"title": {
"text": "title",
"style": "{font-size:20px; color:#F90F0E; font-family: Verdana; text-align: center;}"
},
"y_legend": {
"text": "Values",
"style": "{color:#F90F0E; font-size: 12px}"
},
"x_legend": {
"text": "Date",
"style": "{color:#F90F0E; font-size: 12px}"
},
"elements": [
{
"type": "line",
"colour": "#0000FF",
"width": 2,
"text": "test",
"on-show":{"type":""},
"values": [
{
"x": 1291161976,
"y": 42
},
{
"x": 1291283358,
"y": 10
},
{
"x": 1291334716,
"y": null,
"tip": ""
},
{
"x": 1291421116,
"y": null,
"tip": ""
},
{
"x": 1291507516,
"y": null,
"tip": ""
},
{
"x": 1291593910,
"y": 19
},
{
"x": 1291680310,
"y": 19
},
{
"x": 1291766710,
"y": 19
},
{
"x": 1291853117,
"y": 15
},
{
"x": 1291900196,
"y": 16
},
{
"x": 1291902293,
"y": 17
},
{
"x": 1291946711,
"y": 16
},
{
"x": 1292033116,
"y": 15
},
{
"x": 1292119510,
"y": 17
},
{
"x": 1292205917,
"y": 15
},
{
"x": 1292292315,
"y": 17
},
{
"x": 1292378717,
"y": 15
},
{
"x": 1292465117,
"y": 16
},
{
"x": 1292579504,
"y": 16
},
{
"x": 1292637910,
"y": 16
},
{
"x": 1292724316,
"y": 17
},
{
"x": 1292810716,
"y": 16
},
{
"x": 1292897116,
"y": 16
},
{
"x": 1292983510,
"y": 16
},
{
"x": 1293069915,
"y": 17
},
{
"x": 1293847515,
"y": 10
},
{
"x": 1293933916,
"y": 19
},
{
"x": 1294020316,
"y": null,
"tip": ""
},
{
"x": 1294106716,
"y": null,
"tip": ""
},
{
"x": 1294193115,
"y": null,
"tip": ""
}
]
}
],
"x_axis": {
"stroke": 2,
"tick-height": 5,
"colour": "#000000",
"grid-colour": "#777777",
"min": 1291161976,
"max": 1294193115,
"steps": 151556,
"labels": {
"text": "#date:jS M Y#",
"rotate": "90",
"steps": 151556,
"visible-steps": 1
}
},
"y_axis": {
"stroke": 2,
"tick-length": 1,
"colour": "#000000",
"grid-colour": "#777777",
"steps": 5,
"visible-steps": 5,
"min": 60,
"max": 1
}
}
THIS JSON IS BROKEN:
{
"bg_colour": "#F4F4F4",
"title": {
"text": "title",
"style": "{font-size:20px; color:#F90F0E; font-family: Verdana; text-align: center;}"
},
"y_legend": {
"text": "value",
"style": "{color:#F90F0E; font-size: 12px}"
},
"x_legend": {
"text": "Date",
"style": "{color:#F90F0E; font-size: 12px}"
},
"elements": [
{
"type": "line",
"colour": "#0000FF",
"width": 2,
"text": "test",
"on-show":{"type":""},
"values": [
{
"x": 1291161976,
"y": 42
},
{
"x": 1291283358,
"y": 10
},
{
"x": 1291334716,
"y": null,
"tip": ""
},
{
"x": 1291421116,
"y": null,
"tip": ""
},
{
"x": 1291507516,
"y": null,
"tip": ""
},
{
"x": 1291593910,
"y": 19
},
{
"x": 1291680310,
"y": 19
},
{
"x": 1291766710,
"y": 19
},
{
"x": 1291853117,
"y": 15
},
{
"x": 1291900196,
"y": 16
},
{
"x": 1291902293,
"y": 17
},
{
"x": 1291946711,
"y": 16
},
{
"x": 1292033116,
"y": 15
},
{
"x": 1292119510,
"y": 17
},
{
"x": 1292205917,
"y": 15
},
{
"x": 1292292315,
"y": 17
},
{
"x": 1292378717,
"y": 15
},
{
"x": 1292465117,
"y": 16
},
{
"x": 1292579504,
"y": 16
},
{
"x": 1292637910,
"y": 16
},
{
"x": 1292724316,
"y": null
},
{
"x": 1292810716,
"y": 16
},
{
"x": 1292897116,
"y": 16
},
{
"x": 1292983510,
"y": 16
},
{
"x": 1293069915,
"y": 17
},
{
"x": 1293847515,
"y": 10
},
{
"x": 1293933916,
"y": 19
},
{
"x": 1294020316,
"y": null,
"tip": ""
},
{
"x": 1294106716,
"y": null,
"tip": ""
},
{
"x": 1294193115,
"y": null,
"tip": ""
}
]
}
],
"x_axis": {
"stroke": 2,
"tick-height": 5,
"colour": "#000000",
"grid-colour": "#777777",
"min": 1291161976,
"max": 1294193115,
"steps": 151556,
"labels": {
"text": "#date:jS M Y#",
"rotate": "90",
"steps": 151556,
"visible-steps": 1
}
},
"y_axis": {
"stroke": 2,
"tick-length": 1,
"colour": "#000000",
"grid-colour": "#777777",
"steps": 5,
"visible-steps": 5,
"min": 60,
"max": 1
}
}
i have just changed one of the y values to null. this is enough to break the graph.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
此票现已关闭:
http://forums.openflashchart.com/viewtopic .php?f=5&t=2876&p=7498#p7498
this ticket is now closed:
http://forums.openflashchart.com/viewtopic.php?f=5&t=2876&p=7498#p7498