react-native-graph
react-native-graph copied to clipboard
Can't import AxisLabel
Thanks for this module, animation works very well!
Can you also add an AxisLabel component, that you mention in a README file?
This might help you, so you can create your own: https://github.com/margelo/react-native-graph/issues/3
@skeie : Can you show the code of how you created your label?
Something like this @Angelk90 :
function AxisLabel() {
const x =
(INDEX_OF_YOUR_MAX_OR_MIN_VALUE / LENGTH_OF_YOUR_POINTS_ARRAY) *
GRAPH_WIDTH;
return (
<View style={{ transform: [{ translateX: Math.max(x - 22, 5) }] }}>
<Text color='darkPurple'>
{YOUR_MAX_OR_MIN_VALUE}
</Text>
</View>
);
}
Will close this, as the example from @skeie should be enough to make it work :)