I am currently working on graphing data retrieved from an API. You can find a sample of the data here.
[
{
"id": 10516560,
"username": "acrawford69",
"avatar_url": "https://a.ppy.sh/10516560?1661994504.png",
"country_code": "US",
"country": {
"code": "US",
"name": "United States"
},
"cover_url": "https://assets.ppy.sh/user-profile-covers/10516560/a48a1388412e00cb53f63a18c988460f3a823bc59abfbca57dc0f3178518f828.jpeg",
"playstyle": [
"keyboard",
"tablet"
],
"stats": [
{
"count300": 125059,
"count100": 26906,
"count50": 5572,
"playcount": 1492,
"ranked_score": "103758885",
"total_score": "351690963",
"pp_rank": 483837,
"level": 37.7535,
"pp_raw": 376.591,
"accuracy": 90.7366943359375,
"count_rank_ss": 2,
"count_rank_s": 40,
"count_rank_a": 60,
"timestamp": "2018-01-01T14:05:19Z"
},
// more stats here
]
},
// more users here
While I can successfully plot the graph, I am facing difficulty in configuring the tooltip. I would like the tooltip to display data for the closest point, even if it is far away. An example of what I am aiming for can be found here. I am open to switching chart libraries, as I am currently using echarts.
I have attempted to create a custom tooltip function that searches for the closest value on each line and displays it, but unfortunately, I have not been successful in getting it to work at all.