如何通过HighCharts Android上的图形来传递自定义对象
如何通过HighCharts Android上的图表传递自定义对象? 我想传递图形上点以外的X和Y值以外的其他信息。我想在工具提示中使用的额外信息。 如何在Android上实现这一目标?
我尝试了这样的事情,但它不起作用。
data class GraphPoint(val x:Float, val y:Float, val date:Long)
val readings = ArrayList<List<GraphPoint>>()
readings.add(GraphPoint(1f, 10f, 1657255313)
readings.add(GraphPoint(2f, 5f, 1657255351)
readings.add(GraphPoint(3f, 20f, 1662612113)
val scatter = HIScatter()
scatter.data = readings
How to pass custom object for graph point on HighCharts Android ?
I want to pass extra information other than x and y values for point on graph. That extra information i want to use in tooltip.
How to achieve this on Android ?
I tried something like this, but it did not work.
data class GraphPoint(val x:Float, val y:Float, val date:Long)
val readings = ArrayList<List<GraphPoint>>()
readings.add(GraphPoint(1f, 10f, 1657255313)
readings.add(GraphPoint(2f, 5f, 1657255351)
readings.add(GraphPoint(3f, 20f, 1662612113)
val scatter = HIScatter()
scatter.data = readings
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在这里回答
对于这种情况,我们需要使用地图。在Tooltip中,我们需要通过其映射键等效(例如{key_name})来参考点参数。查看此示例:
Answered here
https://github.com/highcharts/highcharts-android/issues/237
For that case, we will need to use maps. In tooltip, we will need to refer to point parameter by its map key equivalent (e.g. point.{key_name}). Check out this example: