dz 的 Open Flash Chart 2 补丁错误

发布于 2024-10-13 00:06:11 字数 6488 浏览 3 评论 0原文

我正在使用修补版本(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 技术交流群。

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文