{"id":13481296,"url":"https://github.com/krispo/angular-nvd3","last_synced_at":"2025-05-14T19:05:41.598Z","repository":{"id":16477173,"uuid":"19229476","full_name":"krispo/angular-nvd3","owner":"krispo","description":"AngularJS directive for NVD3 reusable charting library (based on D3). Easily customize your charts via JSON API.","archived":false,"fork":false,"pushed_at":"2019-05-09T12:01:25.000Z","size":5377,"stargazers_count":1293,"open_issues_count":412,"forks_count":377,"subscribers_count":74,"default_branch":"master","last_synced_at":"2025-04-09T21:40:47.345Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://krispo.github.io/angular-nvd3","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/krispo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-04-28T06:42:42.000Z","updated_at":"2025-03-23T07:19:13.000Z","dependencies_parsed_at":"2022-09-03T14:31:19.187Z","dependency_job_id":null,"html_url":"https://github.com/krispo/angular-nvd3","commit_stats":null,"previous_names":[],"tags_count":24,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krispo%2Fangular-nvd3","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krispo%2Fangular-nvd3/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krispo%2Fangular-nvd3/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krispo%2Fangular-nvd3/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/krispo","download_url":"https://codeload.github.com/krispo/angular-nvd3/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248322600,"owners_count":21084336,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T17:00:50.554Z","updated_at":"2025-04-13T11:45:58.594Z","avatar_url":"https://github.com/krispo.png","language":"JavaScript","funding_links":[],"categories":["JavaScript","Charts","Chart"],"sub_categories":[],"readme":"# Angular-nvD3\n\n[![Build Status](https://travis-ci.org/krispo/angular-nvd3.svg?branch=master)](https://travis-ci.org/krispo/angular-nvd3)\n[![NPM Version](http://img.shields.io/npm/v/angular-nvd3.svg?style=flat)](https://www.npmjs.org/package/angular-nvd3)\n\nThis thing is designed to make it easier to work with [nvd3.js](https://github.com/novus/nvd3) re-usable charting library. This directive allows you to easily customize your charts via JSON API.\n\nThe key feature is that the original hierarchical structure of nvd3 models is completely preserved in directive JSON structure. This means that while you creating a complex chart that containing multiple elementary chart models (such as `line`, `bar`, `axis`, ...), you can in turn customize the properties of each internal elementary models as well as the global charting properties the way you want. This can be done as usual, but it becomes quite easily to customize while applying JSON approach to. \n\nTry it [online](http://krispo.github.io/angular-nvd3/).\n\n## How to use\n\n### Install\n\n##### cdnjs\n\n    https://cdnjs.cloudflare.com/ajax/libs/angular-nvd3/1.0.9/angular-nvd3.min.js\n\n##### bower\n\n    $ bower install angular-nvd3\n    \nAn [angular.js](https://angularjs.org/), [D3.js](http://d3js.org/) and [nvd3.js](http://nvd3.org/) would be installed as a dependency automatically. If it won't for some reason, install it manually:\n    \n    $ bower install angular\n    $ bower install d3\n    $ bower install nvd3\n\nAdd dependencies to the `\u003chead\u003e` section of your main html:\n```html\n\u003cmeta charset=\"utf-8\"\u003e  \u003c!-- it's important for d3.js --\u003e\n\u003cscript src=\"bower_components/angular/angular.js\"\u003e\u003c/script\u003e\n\u003cscript src=\"bower_components/d3/d3.js\"\u003e\u003c/script\u003e\n\u003cscript src=\"bower_components/nvd3/build/nv.d3.js\"\u003e\u003c/script\u003e \u003c!-- or use another assembly --\u003e\n\u003cscript src=\"bower_components/angular-nvd3/dist/angular-nvd3.js\"\u003e\u003c/script\u003e\n\u003clink rel=\"stylesheet\" href=\"bower_components/nvd3/build/nv.d3.css\"\u003e\n```\n\n##### npm\n\n    $ npm install angular-nvd3\n\n##### download\n\nIf you don't use bower or npm, you can manually download and unpack directive with the latest version ([zip](https://github.com/krispo/angular-nvd3/archive/v1.0.8.zip), [tar.gz](https://github.com/krispo/angular-nvd3/archive/v1.0.8.tar.gz)).\n\n### Basic usage\n\nInject `nvd3` directive into angular module, set up some chart options and push some data to the controller:\n```javascript\nangular.module('myApp', ['nvd3'])\n       .controller('myCtrl', function('$scope'){\n           $scope.options = { /* JSON data */ };\n           $scope.data = { /* JSON data */ }\n        })\n```\n\nand in html again you can use it like:\n```html\n\u003cdiv ng-app='myApp'\u003e\n    \u003cdiv ng-controller='myCtrl'\u003e\n        \u003cnvd3 options='options' data='data'\u003e\u003c/nvd3\u003e\n    \u003c/div\u003e\n\u003c/div\u003e\n```\n\nThe chart would be displayed on the page.\n\n### Example\n\nLet's create a simple **Discrete Bar Chart**.\n\nConfigure options:\n```javascript\n$scope.options = {\n    chart: {\n        type: 'discreteBarChart',\n        height: 450,\n        margin : {\n            top: 20,\n            right: 20,\n            bottom: 60,\n            left: 55\n        },\n        x: function(d){ return d.label; },\n        y: function(d){ return d.value; },\n        showValues: true,\n        valueFormat: function(d){\n            return d3.format(',.4f')(d);\n        },\n        transitionDuration: 500,\n        xAxis: {\n            axisLabel: 'X Axis'\n        },\n        yAxis: {\n            axisLabel: 'Y Axis',\n            axisLabelDistance: 30\n        }\n    }\n};\n```\n\nPush some data:\n```javascript\n$scope.data = [{\n    key: \"Cumulative Return\",\n    values: [\n        { \"label\" : \"A\" , \"value\" : -29.765957771107 },\n        { \"label\" : \"B\" , \"value\" : 0 },\n        { \"label\" : \"C\" , \"value\" : 32.807804682612 },\n        { \"label\" : \"D\" , \"value\" : 196.45946739256 },\n        { \"label\" : \"E\" , \"value\" : 0.19434030906893 },\n        { \"label\" : \"F\" , \"value\" : -98.079782601442 },\n        { \"label\" : \"G\" , \"value\" : -13.925743130903 },\n        { \"label\" : \"H\" , \"value\" : -5.1387322875705 }\n    ]\n}];\n```\n\nSee the [result](http://krispo.github.io/angular-nvd3/#/discreteBarChart).\n\nRead more [docs](http://krispo.github.io/angular-nvd3/#/quickstart).\n\n### Contribute\n\nTest it using command:\n\n    $npm test\n\nThen build using [grunt](http://gruntjs.com/) (*node.js must be installed*):\n\n    $grunt\n\n## Release Notes\n\n### [1.0.9](https://github.com/krispo/angular-nvd3/releases/tag/v1.0.9)\n* add `focus` options\n* fix data update for sunburst chart \n* Node.js/CommonJS support\n\n### 1.0.8\n* fixed zoom feature for delayed data loading\n* fixed caption positioning\n* fixed `updateWithOptions` and `updateWithData` api functions\n\n### 1.0.7\n* added `debounceImmediate` flag\n* added compatibility with nvd3 1.8.3\n\n### 1.0.6\n* merged with nvd3 1.8.2\n* fixed travis\n* fixed npm package dependencies\n* fixed tests\n* added `zoomend` event\n\n### 1.0.5 (nvd3 v1.8.1)\n* fixed `index.js`\n* fixed `onReady` attribute\n* added `getElement` api method\n\n### 1.0.4\n* `deepWatchData = true` by default\n* deleted `autorefresh`, `deepWatchConfig` configs\n* added `deepWatchDataDepth = 2` config to specify watch depth level for data: 0 - by reference (cheap), 1 - by collection item (the middle), 2 - by value (expensive)\n* added `onReady` attribute\n* added `updateWithTimeout`, `refreshWithTimeout` methods to `api`\n* fixed bugs\n\n### 1.0.3\n* Fixed width and height issues for IE: [#16](https://github.com/krispo/angular-nvd3/issues/16), [#158](https://github.com/krispo/angular-nvd3/issues/158), [#200](https://github.com/krispo/angular-nvd3/issues/200), [#226](https://github.com/krispo/angular-nvd3/issues/226).\n* Fixed tooltip issue [#172](https://github.com/krispo/angular-nvd3/issues/172)\n* Set `refreshDataOnly = true` by default\n* Added `zoom \u0026 pan` functionality\n* Fixed tooltip content, subtitle and many other issues...\n\n### 1.0.2\n* Fixed `tooltip` [#222](https://github.com/krispo/angular-nvd3/pull/222) for interactive guideline.\n* Set `deepWatchData` to `false` by default\n* Added `deepWatchOptions` and `deepWatchConfig` properties\n\n### 1.0.1\n* Add support for `Candlestick Chart`, `OHLC Chart`, `Sunburst Chart`, `Pox Plot Chart`\n\n### 1.0.0-rc.2\n* Add support of nvd3 1.8.1\n* Fix [issue](https://github.com/krispo/angular-nvd3/issues/100) with `stacked` parameter\n\n### 1.0.0-rc\n* Rename `utils` module to avoid conflicts\n* Fix nvd3 version reference in bower.json\n* Remove usage of reserved word `class`\n* Fix multiple resize event listeners which were causing null pointer exceptions\n* Change bower.json's main property to use regular instead of minified file\n\n### 1.0.0-beta (nvd3 v1.7.1)\nUnder developing in **master** (1.x) branch\n\n--\n\n\u003e If you use the old nvd3 version (v1.1.15-beta), I recommend you to use an updated assembly (`nv.d3.js` and `nv.d3.css`, you can find it in the `lib` directory of this project) with some fixes rather than the last one installed via bower.\n\n### [0.1.1 (stable for nvd3 v1.1.15-beta)](https://github.com/krispo/angular-nvd3/releases/tag/v0.1.1)\nUnder developing in **0.x** branch\n\n### 0.1.0\n* added update method to global api, [pull request](https://github.com/krispo/angular-nvd3/pull/27)\n* fixed bug for `multiChart`\n* added getScope method to global api. (give an access to internal directive scope, for example, we can get chart object like: `$scope.api.getScope().chart`)\n* fixed multiple chart rendering under initializing (fixed multiple callback calls)\n\n### 0.0.9\n...\n\n## License\nLicensed under the terms of the [MIT License](https://github.com/krispo/angular-nvd3/blob/master/LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkrispo%2Fangular-nvd3","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkrispo%2Fangular-nvd3","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkrispo%2Fangular-nvd3/lists"}