@cz-nic/charli
v0.0.3
Published
Charts library
Downloads
2
Readme
Charli - Charts library
This is a JavaScript library for rendering charts.
The repository contains the Charli, charts library. A library for quick and easy inserting charts into the web page.
.. contents:: Table of Contents :backlinks: none :local:
Dependencies
Are listed in package.json <package.json>
__.
Installation
#. Download or clone the project.
#. Insert all dependencies into your web page:
#. Insert d3 javascript file.
#. Insert c3 javascript file.
#. Insert c3 CSS file.
#. Insert Charli into your webpage:
#. Insert the charli.js
file into your web page.
#. Insert the charli.css
file into your webpage.
Usage
Call the Charli.load_chart(el)
on an element. The element must be configured, it
means it has to have data-chart_type
and data-api_url
attributes.
Many other options of configuration attributes are described in the documentation.
Example
.. code::
<link rel="stylesheet" href="/_path_/_to_/css/c3.min.css">
<link rel="stylesheet" href="/_path_/_to_/css/charli.min.css">
<div
id="my_chart"
data-chart_type="line"
data-api_url="https://www.example.com/api"
></div>
<script type="text/javascript" src="/_path_/_to_/js/d3.min.js"></script>
<script type="text/javascript" src="/_path_/_to_/js/c3.min.js"></script>
<script type="text/javascript" src="/_path_/_to_/js/charli.min.js"></script>
<script type="text/javascript">
Charli.load_chart(document.getElementById("my_chart"));
</script>
Testing
- Run
npm run test
.
Maintainers
- Daniel Hubáček [email protected]
- Karin Strouhalů [email protected]