Socket
Socket
Sign inDemoInstall

@cloudflare/chart-bar

Package Overview
Dependencies
5
Maintainers
35
Versions
571
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cloudflare/chart-bar


Version published
Maintainers
35
Created

Readme

Source

@cloudflare/chart-bar

Cloudflare bar chart presentational components

Installation

Installation with yarn is recommended


$ yarn add @cloudflare/chart-bar

Usage

import React from 'react';
import { TopBarChart } from '../../src';

const randomData = [];
const N_CATEGORIES = 20,
  N_SERIES = 10;
[...Array(N_CATEGORIES).keys()].forEach(cat => {
  [...Array(N_SERIES).keys()].forEach(ser => {
    randomData.push({
      cat: `cat${cat}`,
      ser: `ser${ser}`,
      val: Math.round(Math.random() * 100)
    });
  });
});

const ViewComponent = () => (
  <TopBarChart
    height={420}
    data={randomData}
    categoryDimension="cat"
    stackDimension="ser"
    valueDimension="val"
    topN={20}
    valueLabel="Units"
  />
);

export default ViewComponent;

FAQs

Last updated on 23 May 2024

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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc