angular-chartist.js

Angular directive for Chartist.js

Github星跟踪图

angular-chartist.js

Angular 1.x directive for Chartist.js

Looking for the Angular version?

Installation

Current

npm install angular-chartist.js chartist angular --save
yarn add angular-chartist.js chartist angular

Next

npm install angular-chartist.js@next chartist angular --save
yarn add angular-chartist.js@next chartist angular

Usage

Make sure you have loaded the necessary scripts in the correct order.
Add angular-chartist as a module dependency, like so:

// >= 4.1
import angular from 'angular';
import angularChartist from 'angular-chartist.js';

angular.module('app', [angularChartist]);

In your HTML, add the chartist directive to any div or make it a custom element:

<chartist
  class="ct-chart"
  chartist-data="chartist.barData"
  chartist-chart-type="Bar"
></chartist>
```, Attribute, Type, Required, -----------------------------, ------, --------, `chartist-data`, Object, Yes, `chartist-chart-type`, String, Yes, `chartist-events`\*, Object, No, `chartist-chart-options`, Object, No, `chartist-responsive-options`, Array, No, Format for Chartist events:

```js
{
  event: function eventHandler(obj) {
    // do stuff on event
  }
}

For the sorts of values these options accept, check out the Chartist.js docs

Using Plugins

Simply put the plugins array in the options object.

Example:

$scope.chartOptions = {
  plugins: [
    Chartist.plugins.ctPointLabels({
      textAnchor: 'middle'
    })
  ]
};

Issues?

This directive is simply a wrapper, anything you pass to the directive gets passed right through to the appropriate method
on the Chartist side. Any issues with the charts, data, options, etc, should be filed against Chartist.js

Feel free to file an issue / PR if you feel that the directive can be improved in some way though.

主要指标

概览
名称与所有者willsoto/angular-chartist.js
主编程语言JavaScript
编程语言CSS (语言数: 3)
平台
许可证MIT License
所有者活动
创建于2014-09-10 12:23:36
推送于2022-01-14 13:19:15
最后一次提交2022-01-13 14:25:45
发布数56
最新版本名称v5.0.0-beta.2 (发布于 2018-08-18 20:52:43)
第一版名称v0.1.2 (发布于 2014-09-10 07:03:34)
用户参与
星数204
关注者数9
派生数41
提交数645
已启用问题?
问题数90
打开的问题数0
拉请求数308
打开的拉请求数0
关闭的拉请求数134
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?