rynobax / react-native-plotly

Use plotly.js in React Native!
https://snack.expo.io/@rynobax/react-native-plotly-demo
MIT License
51 stars 10 forks source link

Gauge Charts #33

Closed WGrobler closed 4 years ago

WGrobler commented 4 years ago

I added react-native-plotly to my project and it is working correctly when creating pie or scatter plots, however I am unable to create Gauge charts (Indicators).

My understanding regarding this package is that it uses the latest Plotly.js to draw charts. If that is true shouldn't all the charts in the Javascript library work?

I followed the instructions on https://plotly.com/javascript/gauge-charts/#basic-gauge to determine the correct data layout for the indicator.

Has anyone tried/succeeded in creating Gauge charts in react native?

rynobax commented 4 years ago

By default, only the basic bundle is injected into the webview. If you want to use a chart that is not included in that bundle, such as a gauge chart, you need to set the enableFullPlotly prop to true.

<Plotly
  data={data}
  layout={layout}
  enableFullPlotly
/>
WGrobler commented 4 years ago

Thanks. Adding enableFullPlotly worked.