npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

as-angular-ui-chart

v0.0.1

Published

AS Angular UI Chart Shim

Downloads

12

Readme

ui-chart directive Build Status

This directive allows you to add a jqPlot graph to your application.

Requirements

  • AngularJS
  • jQuery
  • jqPlot

Testing

We use karma and jshint to ensure the quality of the code. The easiest way to run these checks is to use grunt:

npm install -g grunt-cli bower
npm install grunt

The karma task will try to open Chrome as a browser in which to run the tests. Make sure this is available or change the configuration in test\test.config.js

Usage

We use bower for dependency management. Add

dependencies: {
    "angular-ui-chart": "latest"
}

To your bower.json file. Then run

bower install

This will copy the ui-chart files into your bower_components folder, along with its dependencies. Load the script files in your application:

<script type="text/javascript" src="bower_components/jquery/jquery.js"></script>
<script type="text/javascript" src="bower_components/jqplot/jquery.jqplot.js"></script>
<script type="text/javascript" src="bower_components/angular/angular.js"></script>

Add the chart module as a dependency to your application module:

var myAppModule = angular.module('myApp', ['ui.chart'])

Apply the directive to your div elements as an element, attribute, class, or comment:

<ui-chart="data1"></ui-chart>
<div ui-chart="data2"></div>
<div class="ui-chart; data3"></div>
<!-- directive: ui-chart data4 -->

Your data to pass to $.jqplot will be the evaluated value of the ui-chart attribute, while the options to pass to $.jqplot will be the evaluated value of the chart-options attribute - the evaluations are done in scope.

Options

This plugin supports usage of any option present for a chart in jqplot. This value will be provided by the evaluated value in scope on the chart-options attribute.

<ui-chart="data" chart-options="chartOptions"></ui-chart>

angular.module('myApp')
  .controller('DemoCtrl', function ($scope) {
    $scope.data = [[
      ['Heavy Industry', 12],['Retail', 9], ['Light Industry', 14], 
      ['Out of home', 16],['Commuting', 7], ['Orientation', 9]
    ]];

    $scope.chartOptions = { 
      seriesDefaults: {
        // Make this a pie chart.
        renderer: jQuery.jqplot.PieRenderer, 
        rendererOptions: {
          // Put data labels on the pie slices.
          // By default, labels show the percentage of the slice.
          showDataLabels: true
        }
      }, 
      legend: { show:true, location: 'e' }
    };
  });