highcharts / highcharts/highcharts-react-native

Unable to pass actual javascript objects to `data`

Open
#83 9 comments 0 reactions 0 assignees View on GitHub
bug enhancement
Dominant language
JavaScript
Stars
105
Forks
79
PR merge metrics
No merged PRs in 30d

Description

### When trying to render a tooltip, the `data` API option led me down a rabbit hole into the darkest depths of Mordor.

To render useful info in a tooltip, I need to access information living in my RN code from within the webview. "Ah, the `data` option looks promising," I said to myself. Boy, was I wrong.

Passing a string worked fine but this doesn't help me because, ultimately, I need to pass an array of objects. But, passing a data object simply gives you `[object Object]` when trying to reference `data` or `window.data` within some helper functions inside of Highchart's webview.

- "Well, if a normal string works, using `JSON.parse(data)` should work, as well!" Doing so prevented the webview from rendering anything at all. Huh?
- I tried passing `data={JSON.stringify({ foo: "bar" })}` into `` and that also prevented the webview from rendering.
- I fudged with `HighchartsReactNative.js:108` to no avail.

Finally, I asked myself "What gives?", and submitted this issue.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.