tomLadder / react-native-echarts-wrapper

📈Powerful React-Native ECharts Wrapper 📊
MIT License
176 stars 63 forks source link

Cannot use Moment for formatter #24

Closed soyoung97 closed 5 years ago

soyoung97 commented 5 years ago

Hi, first I want to thank you for making a good react native echarts wrapper. I want to use moment for the formatter, but I have trouble making it work, because in my opinion, I have to import it to use it, but I can't import moment to the echarts wrapper.

Is there any way that I can use moment for formatter(including the tooltip formatter)? I attached my code below.

image

tomLadder commented 5 years ago

Hello @soyoung97 !

You can't access anything from your react-native node_modules because these are not available in the webview. In your case i would add a minified version of moment to the index.html. Then there your formatter should work.

Cheers, Tom

cloudychen commented 4 years ago

how to use moment? @tomLadder can you use moment for formatter now? @soyoung97

soyoung97 commented 4 years ago

@cloudychen In the last year's case, I didn't use moment. I instead just used Date. I don't know if it supports moment now.

cloudychen commented 4 years ago

@soyoung97 Thank you for your reply, I can't use moment and I just used Date too.