来自 http://s831.us/ySLjng
我正在开发自己的自定义轴格式化程序。我希望 yAxis 和 Point 标签根据显示的数据类型(例如数量、百分比、美元、英镑等)以不同方式呈现值。
无法仅根据单个值确定数据类型或点。数据类型的上下文在系列或图表上设置。它不是静态设置一次的。我根据用户输入动态检索不同的数据集(例如金融工具符号.DJI、AAPL、BP.L 等)。
我还没有找到从轴或工具提示格式化程序访问系列或图表上下文的方法。我也无法找到在 Ajax“成功”处理程序中重置格式化程序的方法。
有什么建议吗?
更新:最初的问题询问了轴和工具提示格式化程序的上下文。工具提示格式化程序确实通过 this.series 获取了该系列。我在轴格式化程序中没有找到类似的上下文。
From http://s831.us/ySLjng
I am developing my own custom Axis Formatter. I would like the yAxis and Point labels to render values differently depending on the type of data being displayed (e.g. volume, percentage, US dollars, British Pound, etc.)
It is not possible to determine the type of data from just the single value or point. The context of the type of data is set on the series or chart. It is not set once statically. I retrieve different data sets dynamically using based on users inputs (e.g. financial instrument symbol .DJI, AAPL, BP.L, etc.).
I have not found a way to access the series or chart context from the Axis or Tooltip formatter. I have also not been able to find a way to reset the formatter in the Ajax "success" handler.
Any suggestions?
UPDATE: The original question asked about context for both the Axis and Tooltip Formatter.The Tooltip formatter does get the series via this.series. I haven't found an analogues context in the Axis Formatter.
发布评论
评论(1)
它还不是正式版本的一部分,但我刚刚将
axis
和chart
添加到轴格式化程序的 this-context 中,因此现在可以执行以下操作:jsfiddle
链接到HighCharts
It's not part of an official release yet, but I just added
axis
andchart
to this-context in the axis formatters, so the following is now possible:Example on jsfiddle
Link to the latest development version of HighCharts