# chartz

> An easy to use, simple looking HTML5 chart renderer.

Latest version **1.1.4** (published 2019-05-13) · MIT license · 0 weekly downloads

## Install

```sh
npm install chartz
pnpm add chartz
yarn add chartz
bun add chartz
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.4 |
| Published | 2019-05-13 |
| First published | 2019-05-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 51.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Nick Neuman |
| Maintainers | neecholaus |
| Keywords | charts, chartz, chart, visualization, javascript |

## Links

- npm: https://www.npmjs.com/package/chartz
- Repository: https://github.com/neecholaus/chartz
- Homepage: https://github.com/neecholaus/chartz#readme
- Issues: https://github.com/neecholaus/chartz/issues
- npm.io page: https://npm.io/package/chartz

## Alternatives

- [d3-force-3d](https://npm.io/package/d3-force-3d.md) — 1.0M weekly downloads
- [ng2-charts](https://npm.io/package/ng2-charts.md) — 486.8K weekly downloads
- [@arcgis/core](https://npm.io/package/@arcgis/core.md) — 257.8K weekly downloads
- [react-sparklines](https://npm.io/package/react-sparklines.md) — 249.3K weekly downloads
- [react-native-gifted-charts](https://npm.io/package/react-native-gifted-charts.md) — 182.3K weekly downloads

## Recent versions

- 1.1.4 (latest) — 2019-05-13
- 1.1.3 — 2019-05-10
- 1.0.3 — 2019-05-08
- 1.0.1 — 2019-05-06
- 1.0.0 — 2019-05-06

## README

# Chartz
![Version](https://img.shields.io/npm/v/chartz.svg)
![Downloads](https://img.shields.io/npm/dw/chartz.svg)
![License](https://img.shields.io/npm/l/chartz.svg)

![Sreenshot of an example](./docs/example.png)

## Getting Started:
First you need to require the module in your bundled javascript file.
```js
const Chart = require('chartz');
```
Once the javascript is taken care of, you need to import the scss file.
```scss
@import('chartz/chartz')
```
Support for vanilla JS or CSS via `<script>` or `<link>` tags is not currently available, but that is part of the roadmap.

Initialize a new chart with:
```js
new Chart(elementId, options);
```
## Example:
The following options will give you this chart.
![Second example screenshot](./docs/example2.png)
```js
let options = {
  items: [
    {
      height: 200,
      x: 'Stat 1'
    },
    {
      height: 100,
      x: 'Stat 2'
    },
    {
      height: 300,
      x: 'Stat 3',
      classes: ['success']
    }
  ],
  column: {
    maxWidth: 150
  }
}
```

## Options
The bare necessities for the options is this:
```js
let options = {
  items: [{
    name: <string>,
    height: <int>
  }]
}
```
```js
let options = {
  items: [],
  type: <string>, /* Defaults to 'bar-vertical' */
  container: {
    height: <string>, /* Optional | Passed exactly as given */
    width: <int> /* Optional | Passed as percentage */
  },
  column: {
    maxWidth: <int>, /* Optional | Passed as px */
  },
  axisPosition: <string> /* Optional | Default is bottom, can also choose top */
}
```

## Chart Types:
There are many types on the roadmap, but for now there is only one – `bar-vertical`. Please let me know what charts you would find most useful.


## Item Interface
```js
let item = {
  name: <string>, /* Optional | Displayed inside of the bars */
  height: <int>,
  classes: <array of strings>, /* Optional */
  x: <string> /* Optional | Will be displayed outside of the chart on either the top or bottom */
}
```

### Additional Options
By default you can add any of the following classes to an item to achieve similar styling to Bootstrap's associated colors.
`success`  `danger`  `info` `secondary` `warning`  `secondary`

---
_Source: https://npm.io/package/chartz · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
