• Stars
    star
    356
  • Rank 119,446 (Top 3 %)
  • Language
    JavaScript
  • Created over 10 years ago
  • Updated over 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

💹 angularjs bindings for baidu echarts

eCharts + AngularJS

AngularJS directives to use eCharts

Prerequisites

You will need the following things properly installed on your computer.

Breaking Changes in V1

  • echart support is v3.4.0;
  • angular support is v1.6.2;
  • map chart requires additional work, see below;
  • custome themes are removed, all uses the build in ones;

Building

  • Preparing bower install & npm install

  • default gulp

develop with realtime monitor, automatic open browser to view example

  • build gulp build

Build file to dist

  • publish gulp publish

Build & bump npm versions

Usage

Install bower dependency and save for production

$ bower install angular-echarts --save

Inject echarts and angular-echarts file into page

<script src="path/to/bower_components/echarts/dist/echarts.js"></script>
<script src="path/to/bower_components/angular-echarts/dist/angular-echarts.min.js"></script>

Download and inject map definitions if you want a map chart: http://echarts.baidu.com/download-map.html

Add dependency and declare a demo controller

var app = angular.module('demo', ['angular-echarts']);
app.controller('LineChartController', function ($scope) {

    var pageload = {
        name: 'page.load',
        datapoints: [
            { x: 2001, y: 1012 },
            { x: 2002, y: 1023 },
            { x: 2003, y: 1045 },
            { x: 2004, y: 1062 },
            { x: 2005, y: 1032 },
            { x: 2006, y: 1040 },
            { x: 2007, y: 1023 },
            { x: 2008, y: 1090 },
            { x: 2009, y: 1012 },
            { x: 2010, y: 1012 },
        ]
    };

    var firstPaint = {
        name: 'page.firstPaint',
        datapoints: [
            { x: 2001, y: 22 },
            { x: 2002, y: 13 },
            { x: 2003, y: 35 },
            { x: 2004, y: 52 },
            { x: 2005, y: 32 },
            { x: 2006, y: 40 },
            { x: 2007, y: 63 },
            { x: 2008, y: 80 },
            { x: 2009, y: 20 },
            { x: 2010, y: 25 },
        ]
    };

    $scope.config = {
        title: 'Line Chart',
        subtitle: 'Line Chart Subtitle',
        debug: true,
        showXAxis: true,
        showYAxis: true,
        showLegend: true,
        stack: false,
    };

    $scope.data = [ pageload ];
    $scope.multiple = [pageload, firstPaint ];

});

Use this markup for a quick demo

<div class="col-md-3" ng-controller="LineChartController">
    <line-chart config="config" data="data"></line-chart>
    <line-chart config="config" data="multiple"></line-chart>
</div>

Contribute

  • git clone [email protected]:wangshijun/angular-echarts.git
  • change into the new directory
  • npm install
  • bower install

Running / Development

  • open docs/index.html in browser

Or you can use gulp server and visit http://localhost:8080 in Chrome browser, to avoid XMLHttpRequest Cross origin requests error.

More Repositories

1

course-new-features-of-react16

🔥 Source code for course "new features of react 16"
JavaScript
58
star
2

automated-workflow-with-npm-script

使用 npm script 打造超溜的前端自动化工作流
JavaScript
56
star
3

ethereum-dapp-nuxt

基于前端开发环境的以太坊智能合约 + DApp 工作流,包含编译、部署、测试等环节,Nuxt 版本
Vue
53
star
4

ethereum-contract-workflow

基于前端开发环境的以太坊智能合约工作流,包含编译、部署、测试等环节
JavaScript
51
star
5

course-styled-components-fundamentals

🔥 Source code for course "styled-components fundamentals"
JavaScript
39
star
6

ethereum-lottery-dapp

以太坊智能合约+DApp 工作流实战案例:抽奖程序
JavaScript
38
star
7

feweekly

⭐ 前端周刊,让你在前端领域跟上时代的脚步,深度和广度不断精进
34
star
8

generator-angular-cordova

Yeoman Generator for a Angular-Ionic-Cordova powered webapp
JavaScript
25
star
9

mixin-node-client

More developer friendly Node.js SDK for Mixin network
JavaScript
14
star
10

hello-nodeblog

nodeblog source code for maiziedu
HTML
9
star
11

course-js-fullstack-wechat

微信公众号JS全栈开发实战Demo
CSS
8
star
12

stock-monitor

实时监控股价,并通过系统通知或者短信通知你
JavaScript
8
star
13

angular-bootstrap-chosen

angular-bootstrap-chosen
CSS
6
star
14

zepto-appjs-zhihu

基于 Zepto 和 App.js 开发的知乎日报 WebAPP
CSS
5
star
15

npm-script-workflow

demo for npm-script-workflow
JavaScript
5
star
16

course-advanced-console-logging

🔥 Source files for course advanced javascript logging
JavaScript
5
star
17

top-5-e2e-framework

最受欢迎的 5 款 Node.js E2E 测试框架
JavaScript
5
star
18

githooks_old

my project githooks
PHP
4
star
19

wechat-baidu-robot

Wechat Baidu Robot
CSS
4
star
20

mixin-cli

Command line utility tools for ease mixin dapp development
JavaScript
4
star
21

candy-value-marketcap

计算 candy 市值和价值的脚本
JavaScript
2
star
22

wangshijun.github.io

my blog using github pages
CSS
2
star
23

cs50

cs50
C
2
star
24

forge-demo-script

Demo code for blockchain odyssey demo
JavaScript
1
star
25

fullstackacademy.io

所有我整理、录制、创作的东西
CSS
1
star
26

front-end-enginnering-demo

前端工程化各种工具的入门 Demo
JavaScript
1
star
27

angular-humanize

angular filter for formatting numbers, currencies
1
star
28

d3railway

d3 visualization for railway stations
JavaScript
1
star
29

cakephp-plugins

Collection of usefull CakePHP plugins
PHP
1
star