1.0.7 • Published 4 months ago

react-native-amcharts v1.0.7

Weekly downloads
-
License
ISC
Repository
github
Last release
4 months ago

React-Native amCharts

Unofficial React-Native wrapper package for using AmCharts.

Features

  1. Fully customizable wrapper for AmCharts4 using JSON-based Config.

  2. Supported on IOS and Android.

Installing

Get package from NPM in your React-native app:

npm i react-native-amcharts

Basic Usage Example

import React from 'react';
import { Stylesheet } from 'react-native';
import AMCharts from 'react-native-amcharts';

const config = {
  // Create pie series
  series: [
    {
      type: 'PieSeries',
      dataFields: {
        value: 'litres',
        category: 'country',
      },
    },
  ],

  // Add data
  data: [
    {
      country: 'Lithuania',
      litres: 501.9,
    },
    {
      country: 'Czech Republic',
      litres: 301.9,
    },
    {
      country: 'Ireland',
      litres: 201.1,
    },
      {
        country: "Germany",
        litres: 165.8,
      },
      {
        country: "Australia",
        litres: 139.9,
      },
      {
        country: "Austria",
        litres: 128.3,
      },
      {
        country: "UK",
        litres: 99,
      },
      {
        country: "Belgium",
        litres: 60,
      },
      {
        country: "The Netherlands",
        litres: 50,
      },
  ],

  // And, for a good measure, let's add a legend
  legend: {},
};

const App = () => {
  return (
    <>
      <AMCharts
        type="PieChart"
        config={config}
        style={styles.chartContainer}
      />
    </>
  );
};

const styles = Stylesheet.create({
  chartContainer: {
    height: '50%',
    width: '100%',
  },
});
export default App;

Props Defitnition

  • type Chart type definition from amcharts library

  • config JSON config for displaying the charts

  • style Styling chart container

Repository for reference

1.0.7

4 months ago

1.0.6

6 months ago

1.0.5

6 months ago

1.0.4

6 months ago

1.0.2

8 months ago

1.0.3

8 months ago

1.0.1

8 months ago

1.0.0

8 months ago

0.0.2-g

4 years ago

0.0.2-f

4 years ago

0.0.2-e

4 years ago

0.0.2-d

4 years ago

0.0.2-c

4 years ago

0.0.2-b

4 years ago

0.0.2-a

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago