npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-amcharts4

v0.0.4

Published

A react wrapper component for `@amcharts/amcharts4` where (any) chart is rendered using JSON config pattern of @amcharts/amcharts4 and also taking care of updates to the rendered charts.

Downloads

271

Readme

Amcharts4 React

A react wrapper component for @amcharts/amcharts4 where (any) chart is rendered using JSON config pattern of @amcharts/amcharts4 and also taking care of updates to the rendered charts.

Install

npm install --save react-amcharts4

Usage

import React from "react";

import AmChart4Wrapper from "react-amcharts4";

import { PieChart } from "@amcharts/amcharts4/charts";

// Configure any reguired theme
import * as am4core from "@amcharts/amcharts4/core";
import am4themes_material from "@amcharts/amcharts4/themes/material";

am4core.useTheme(am4themes_material);

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
    }
  ]
};

const Demo = props => {
  return (
    <div style={{ width: "80%", margin: "0 auto" }}>
      <AmCharts4Wrapper
        config={config}
        id="amcharts-4"
        chartTypeClass={PieChart}
      />
    </div>
  );
};

export default Demo;

Note: For information on the chart's config, refer @amcharts/amchart4 documentation.

License

MIT © Abhishek Ramesh