dz的Open Flash Chart 2补丁bug

时间:2011-01-19 16:33:12

标签: openflashchart2 ofc

我正在使用修补版本(http://ofc2dz.com),因为我需要“null-gap”的功能:true。我有一个线图,工作正常,空值和没有。当我将一个y值更改为null时,图表会在顶部显示一个蓝色面板。好消息是,我有json工作,而json有小变化打破了图形。我希望一个开放的Flash图表大师会发现我所犯的错误。我已粘贴下面的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。这足以打破图表。

1 个答案:

答案 0 :(得分:0)