日本語のREADMEはこちらです: README.ja.md
c3-es is the ES module version of C3.js, a D3-based reusable chart library that enables deeper integration of charts into web applications. This fork provides a simple way to use C3.js in modern web projects directly from a CDN, without a build step.
To use c3-es, import the initC3 function from the module and call it with the window object. This helper function handles the setup of the D3.js dependency and automatically loads the required CSS file.
<div id="chart"></div>
<script type="module">
// Import the initializer from the c3-es module
import { initC3 } from "https://code4fukui.github.io/c3-es/c3-es.js";
// Initialize C3 and get the c3 object
const c3 = initC3(window);
// Generate a chart
const chart = c3.generate({
bindto: '#chart',
data: {
columns: [
['data1', 30, 200, 100, 400, 150, 250],
['data2', 50, 20, 10, 40, 15, 25]
]
}
});
</script>This module is generated by make_c3-es.js from the official c3.esm.js file.
Since c3-es is a repackaging of C3.js, you can refer to the official C3.js documentation for all charting options and API methods.
Additional samples can be found in the original C3.js repository:
You can run these samples locally by cloning the original repository and running:
$ npm run serve-static- Google Group: For general questions and discussions, please visit the C3.js Google Group.
- Gitter: For live chat with the community, join the Gitter channel.
- Issues: The issue queue is for reporting bugs and requesting features in the original C3.js library. It is not a general support forum.
- D3.js
^5.0.0(loaded automatically via Skypack CDN)
MIT