Store and recall extra data for a point #922
-
QuestionHi, The record id can then be used to retrieve additional data such as duration, longitude, latitude, etc. Now I can place the time and magnitude into a series and graph it. I then want to use the record id at certain times based on user interactions. Perhaps by implementing a markerVisibilityListener which recalls the additional data and displays it to the user when a point is selected on the graph. How would I go about storing and recalling these additional fields? My initial thought was to store it in the ExtraStore as an array of record ids. Then when a point is selected, I could use the index of the selected point to get the corresponding record id. This didn't work out for me however, because the index does not appear to be exposed. CartesianMarker.Target only has the x value, and LineCartesianLayerMarkerTarget.points has the entry which just has the x and y value. I suppose I could store the original data as an Extra and then try to search through it for the x value. That doesn't seem like an optimal way to do things. The x's are relatively high precision floating point values, so I would also need to have confidence that there are no comparison errors when comparing the value provided by Vico with the original value stored in Extras. Thanks Vico version(s)2.0.0-beta.1 UI framework(s)Jetpack Compose |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hello! I’d suggest creating a map that links x values to record IDs and storing that as an extra. This would enable you to retrieve the record IDs in a concise and performant manner. No precision-related issues should occur—Vico uses and provides the exact x values that you specify. |
Beta Was this translation helpful? Give feedback.
Hello! I’d suggest creating a map that links x values to record IDs and storing that as an extra. This would enable you to retrieve the record IDs in a concise and performant manner. No precision-related issues should occur—Vico uses and provides the exact x values that you specify.