-
-
Notifications
You must be signed in to change notification settings - Fork 667
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Custom Horizontal Lines #636
Comments
any solutions? |
Any Update? |
Any Update on this ? |
any update? |
cekin on it, but seems i cannot implement it yet. |
find way arround using decorator import React from 'react';
import { View, Text } from 'react-native';
import { LineChart } from 'react-native-chart-kit';
import { Dimensions } from 'react-native';
import { Svg, Line } from 'react-native-svg';
const CustomLineChart = () => {
const screenWidth = Dimensions.get('window').width;
const data = {
labels: ["January", "February", "March", "April", "May", "June"],
datasets: [
{
data: [20, 45, 28, 80, 99, 43],
strokeWidth: 2,
},
],
};
const customDecorator = () => {
return (
<Svg>
<Line
x1="0"
y1="50"
x2={screenWidth}
y2="50"
stroke="red"
strokeWidth="2"
/>
</Svg>
);
};
return (
<View>
<Text>Custom Horizontal Line Chart</Text>
<LineChart
data={data}
width={screenWidth}
height={220}
chartConfig={{
backgroundGradientFrom: "#fff",
backgroundGradientTo: "#fff",
color: (opacity = 1) => `rgba(0, 0, 0, ${opacity})`,
}}
decorator={customDecorator}
/>
</View>
);
};
export default CustomLineChart; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello,
I'm coding stock chart and I need draw same horizontal lines on chart.
How can I add a horizontal line to position which I want in my chart?
Thanks
The text was updated successfully, but these errors were encountered: