0.0.3 • Published 4 years ago

@cz-nic/charli v0.0.3

Weekly downloads
3
License
GPL-3.0-or-later
Repository
-
Last release
4 years ago

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

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago