Security News
Bun 1.2 Released with 90% Node.js Compatibility and Built-in S3 Object Support
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
react-native-simple-line-chart
Advanced tools
A fast, interactive, animated and simple line chart component for React Native
A simple, interactive, animated, and fast Line Chart component for React Native.
yarn example [ios/andriod]
or watch this Videonpm install react-native-simple-line-chart
or
yarn add react-native-simple-line-chart
⚠️ Make sure you have react-native-reanimated + react-native-gesture-handler + react-native-svg installed in your project.
import * as React from 'react';
import { View, Dimensions, Text } from 'react-native';
import { GestureHandlerRootView } from 'react-native-gesture-handler';
import LineChart from 'react-native-simple-line-chart';
export default function App() {
return (
<GestureHandlerRootView style={{ flex: 1 }}>
<View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
<LineChart
lines={[
{
data: [
{
y: 10,
x: new Date('2020-01-01').getTime(),
extraData: {
formattedValue: '0',
formattedTime: '2020-01-01',
},
},
{
y: 20,
x: new Date('2020-01-02').getTime(),
extraData: {
formattedValue: '20',
formattedTime: '2020-01-02',
},
},
{
y: 15,
x: new Date('2020-01-03').getTime(),
extraData: {
date: new Date('2020-01-03').getTime(),
formattedValue: '15$',
formattedTime: '2020-01-03',
},
},
{
y: 35,
x: new Date('2020-01-04').getTime(),
extraData: {
formattedValue: '35$',
formattedTime: '2020-01-04',
},
},
{
y: 5,
x: new Date('2020-01-06').getTime(),
extraData: {
formattedValue: '35$',
formattedTime: '2020-01-04',
},
},
],
activePointConfig: {
color: 'black',
showVerticalLine: true,
},
lineColor: 'pink',
curve: 'linear',
endPointConfig: {
color: 'pink',
radius: 5,
animated: true,
},
activePointComponent: (point) => {
return (
<View
style={{
backgroundColor: 'pink',
padding: 10,
borderRadius: 10,
}}
>
<Text style={{ color: 'white' }}>
{point?.extraData?.formattedValue}
</Text>
<Text style={{ color: 'white' }}>
{point?.extraData?.formattedTime}
</Text>
</View>
);
},
},
]}
backgroundColor={undefined}
height={200}
width={Dimensions.get('screen').width}
/>
</View>
</GestureHandlerRootView>
);
}
FAQs
A fast, interactive, animated and simple line chart component for React Native
The npm package react-native-simple-line-chart receives a total of 116 weekly downloads. As such, react-native-simple-line-chart popularity was classified as not popular.
We found that react-native-simple-line-chart demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.