我需要将高选项选项转换为JSON字符串。我真的很为此苦苦挣扎。Highcharts将字符串化JSON的选项
因为它有cuircual结构。
嗯,我也试图与道格拉斯·克罗克福特cycle.js到decycle它:https://github.com/douglascrockford/JSON-js
如果我尝试decycle它,我得到这个堆栈跟踪
'Attr.ownerElement' is deprecated and has been removed from DOM4 (http://w3.org/tr/dom). cycle.js:92
'Attr.textContent' is deprecated. Please use 'value' instead. cycle.js:92
'Attr.nodeValue' is deprecated. Please use 'value' instead. cycle.js:92
'HTMLHtmlElement.manifest' is deprecated. The manifest attribute only has an effect during the early stages of document load. cycle.js:92
InvalidStateError: Failed to read the 'selectionDirection' property from 'HTMLInputElement': The input element's type ('checkbox') does not support selection.
嗯,我需要这是因为我想要保存配置我的图表和稍后使用该配置加载它。
有没有办法做到这一点?
感谢
感谢您的好的答案,我想这就是我现在正在做的。那么在我的情况下,它更复杂一点,因为我试图建立一个更新和改变结果的动态图表。但是我已经定义了一些更新我自己的配置的更新方法,然后将其转换为JSON,再次存储并加载。 – 2014-09-04 12:09:20