c3-react

WebJar for c3-react

License

License

MIT
Categories

Categories

React User Interface Web Frameworks
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

c3-react
Last Version

Last Version

0.1.13
Release Date

Release Date

Type

Type

jar
Description

Description

c3-react
WebJar for c3-react
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/terry81811/c3-react

Download c3-react

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/c3-react/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>c3-react</artifactId>
    <version>0.1.13</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/c3-react/
implementation 'org.webjars.npm:c3-react:0.1.13'
// https://jarcasting.com/artifacts/org.webjars.npm/c3-react/
implementation ("org.webjars.npm:c3-react:0.1.13")
'org.webjars.npm:c3-react:jar:0.1.13'
<dependency org="org.webjars.npm" name="c3-react" rev="0.1.13">
  <artifact name="c3-react" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='c3-react', version='0.1.13')
)
libraryDependencies += "org.webjars.npm" % "c3-react" % "0.1.13"
[org.webjars.npm/c3-react "0.1.13"]

Dependencies

compile (3)

Group / Artifact Type Version
org.webjars.npm : c3 jar [0.4.10,0.5)
org.webjars.npm : d3 jar [3.5.5,4)
org.webjars.npm : lodash jar [3.9.3,4)

Project Modules

There are no modules declared in this project.

c3-react

c3-react is a reusable react component for c3 charts demo

How to install

npm install c3-react

How to use

const C3Chart = require("./C3Chart.jsx");
  • In parnet component
<C3Chart data={data} type={type} options={options}/>
  • data example:
let data = [
  {
    key: "dataSource1"
    values: [
      {label: "A", value: 3},
      {label: "B", value: 4}
    ]
  },
  {
    key: "dataSource2"
    values: [
      {label: "X", value: 7},
      {label: "Y", value: 8}
    ]
  }
]
  • supported types
let type = "bar" // {"line","bar","pie", "multiBar","lineBar"}
  • options example
let options = {
  padding: {
    top: 20,
    bottom: 20,
    left: 40,
    right: 10
  },
  size: {
    width: 800,
    height: 600
  },
  subchart: true,
  zoom: true,
  grid: {
    x: false,
    y: true
  },
  labels: true,
  axisLabel: {
    x: "product",
    y: "quantity"
  },
  onClick: function(d) {
    let categories = this.categories(); //c3 function, get categorical labels
    console.log(d);
    console.log("you clicked {" + d.name + ": " + categories[d.x] + ": " + d.value + "}");
  }
};

How to run examples

$ cd c3-react
$ npm install 
$ npm run dev

Release Note

  • 0.1.6 - provide compiled es5 module

Dependency

License

MIT

Versions

Version
0.1.13