Socket
Book a DemoInstallSign in
Socket

react-native-charts-fabric

Package Overview
Dependencies
Maintainers
2
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-charts-fabric

test

0.1.16
latest
Source
npmnpm
Version published
Maintainers
2
Created
Source

react-native-charts

charts wrapper for react native

Installation

npm install react-native-charts-fabric

Usage

import { BarChartView, LineChartView, PieChartView } from 'react-native-charts-fabric';

// ... LineChart is the same as BarChart 

    <BarChartView
        xAxis={{
          max: 10,
          categories: yearLabels(),
          lineColor: '#124322',
          lineWidth: 5,
          labels: { style: { color: '#129922', fontSize: 12 } },
        }}
        yAxis={{
          min: 0,
          tickAmount: 6,
          labels: { style: { color: '#000000', fontSize: 10 } },
          gridLineColor: '#ffffff',
          gridLineWidth: 1,
        }}
        seriesData={{
          series: {
            data: [
              {
                color: '#455555',
                data: testSeries(),
              },
              {
                color: '#887777',
                data: testSeries(),
              },
            ],
          },
          colors: ['#455555', '#887777'],
        }}
        style={styles.box}
    />
// ... fake data
    function yearLabels() {
        const yearsData = [];
        for (var i = 0; i <= 20; i++) {
            yearsData.push((i + 2020).toString());
        }
        return yearsData;
    }

    function testSeries() {
        var seriesData = [];
        for (var i = 0; i <= 20; i++) {
            seriesData.push({
            x: i,
            y: Math.floor(Math.random() * 20),
            });
        }
  return seriesData;
}
// .....
    <PieChartView
        plotOptions={{
          pie: {
            borderWidth: 1,
            innerSize: 0,
          },
        }}
        seriesData={{
          series: {
            data: testPieSeries(),
          },
          colors: [
            '#455555',
            '#121212',
            '#887277',
            '#187777',
            '#587777',
            '#517227',
          ],
        }}
        style={styles.box}
      />

    function testPieSeries() {
    var seriesData = [];
        for (var i = 0; i <= 5; i++) {
            seriesData.push({
            color: '#882277',
            name: 'DataX',
            y: Math.floor(Math.random() * 20 + 1),
            });
        }
        return seriesData;
    }

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT

Made with create-react-native-library

Keywords

react-native

FAQs

Package last updated on 18 Oct 2023

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.