@cdc/chart

4.25.3 • Public • Published

@cdc/chart

npm

<CdcChart /> is a React component produced by the CDC for visualizing your data in a chart. Some supported types are Line, bar, pie, combination and horizontal bar chart. This package is part of the larger CDC Open Visualization project.

Installation and Usage

  1. Install the package in your React project npm install @cdc/chart
  2. Import the component and begin using in your code.
import CdcChart from '@cdc/chart'

function App() {

  return (
    <div className="App">
      <CdcChart config={configObj} />
    </div>
  );
}

export default App;

Note, you must pass in a configuration object. Configuration objects can be created with the Editor package.

Sample config data can be found in packages/chart/examples.

Properties

Property Type Description
config String A JavaScript object with the configuration for the chart. Pass either this or the configUrl property to setup your chart.
configUrl String Pass a URL to a .json file and it will be consumed and used as the configuration.

/@cdc/chart/

    Package Sidebar

    Install

    npm i @cdc/chart

    Weekly Downloads

    5

    Version

    4.25.3

    License

    Apache-2.0

    Unpacked Size

    7.28 MB

    Total Files

    323

    Last publish

    Collaborators

    • cooms13
    • adoe
    • mpallansch