Closed nbasael closed 4 years ago
I made a .gif!
Have you tried to update to the newest version and apply webView styles?
https://github.com/highcharts/highcharts-react-native/blob/master/README.md#webviewStyles
Have you tried to update to the newest version and apply webView styles?
https://github.com/highcharts/highcharts-react-native/blob/master/README.md#webviewStyles
Yes, i have the latest version and i already applied webView styles but the issue is still present. Any other workaround?
Does the problem happen in iOS or Android? Are you able to simplify your styles and paste here? I will try to reproduce it on my own test machine.
Only on Android, im not working on IOS in this moment. I will try to replicate the issue in another section
I wasnt able to replicate this error in another section. I will start to rewrite the code and i will be in touch if i find something new. Thanks for your reply!
I've managed to do it in the React Native starter template
Here is the code:
import React from 'react';
import {
SafeAreaView,
StyleSheet,
ScrollView,
View,
Text,
StatusBar,
} from 'react-native';
import {
Header,
LearnMoreLinks,
Colors,
DebugInstructions,
ReloadInstructions,
} from 'react-native/Libraries/NewAppScreen';
import HighchartsReactNative from '@highcharts/highcharts-react-native';
export default class App extends React.Component {
constructor(props) {
super(props);
this.state = {
chartOptions: configTest
}
}
render(){
return (
<>
<StatusBar barStyle="dark-content" />
<SafeAreaView>
{/* Chart Here */}
<HighchartsReactNative
styles={styles.chartStyle}
options={this.state.chartOptions}
loader={true}
/>
<ScrollView
contentInsetAdjustmentBehavior="automatic"
style={styles.scrollView}>
<Header />
{global.HermesInternal == null ? null : (
<View style={styles.engine}>
<Text style={styles.footer}>Engine: Hermes</Text>
</View>
)}
<View style={styles.body}>
<View style={styles.sectionContainer}>
<Text style={styles.sectionTitle}>Step One</Text>
<Text style={styles.sectionDescription}>
Edit <Text style={styles.highlight}>App.js</Text> to change this
screen and then come back to see your edits.
</Text>
</View>
<View style={styles.sectionContainer}>
<Text style={styles.sectionTitle}>See Your Changes</Text>
<Text style={styles.sectionDescription}>
<ReloadInstructions />
</Text>
</View>
<View style={styles.sectionContainer}>
<Text style={styles.sectionTitle}>Debug</Text>
<Text style={styles.sectionDescription}>
<DebugInstructions />
</Text>
</View>
<View style={styles.sectionContainer}>
<Text style={styles.sectionTitle}>Learn More</Text>
<Text style={styles.sectionDescription}>
Read the docs to discover what to do next:
</Text>
</View>
<LearnMoreLinks />
</View>
</ScrollView>
</SafeAreaView>
</>
);
}
}
const configTest = {
chart: {
type: 'column'
},
credits: null,
series: [{
data: [49.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4]
}],
}
const styles = StyleSheet.create({
chartStyle: {
height: 300,
width: '100%'
},
scrollView: {
backgroundColor: Colors.lighter,
},
engine: {
position: 'absolute',
right: 0,
},
body: {
backgroundColor: Colors.white,
},
sectionContainer: {
marginTop: 32,
paddingHorizontal: 24,
},
sectionTitle: {
fontSize: 24,
fontWeight: '600',
color: Colors.black,
},
sectionDescription: {
marginTop: 8,
fontSize: 18,
fontWeight: '400',
color: Colors.dark,
},
highlight: {
fontWeight: '700',
},
footer: {
color: Colors.dark,
fontSize: 12,
fontWeight: '600',
padding: 4,
paddingRight: 12,
textAlign: 'right',
},
});
Thank you for the feedback. It sounds good!
If you can, please create a PR with docs about your solution (FAQ section) or leave summarize of it here.
Thank you for the feedback. It sounds good!
If you can, please create a PR with docs about your solution (FAQ section) or leave summarize of it here.
No, wait! Sorry for the misunderstanding, i've managed to replicate the error on the React Native starter template with the code above. I'm still working on this, but i need to advance in other sections too.
I apologize for my misunderstood.
Reopened the ticket.
Closing this issue. It seems when i display a chart with a lot of data it renders way beyond of the WebView container. With small amount of data we are not having any issue so we decided to do not go with large charts. Hoping that this gets fixed in future updates, cheers!
@nbasael are you able to paste "a lot of data", because Im courios of effect and need to test it.
Hi!
I have an issue with this library. When i need to show the chart it renders without any problem but sometimes it renders way beyond of the WebView container.
React Native version (no Expo): 0.61.4 Highcharts version: ^2.1.1
Expected:
The issue:
And the code is the following:
GraficoMedicion.js:
which is exported to:
PantallaKW.js:
I dont know if im doing something wrong or if it is a bug, but when i change the code inside GraficoMedicion.js and hot reload the app the chart renders correctly. If you need more information i will be happy to give it! and sorry for my english, im not very good at yet.
Cheers!