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 🙏

© 2026 – Pkg Stats / Ryan Hefner

angular-highsmorks

v1.0.0

Published

Yet another Highcharts interface.

Downloads

11

Readme

Highsmorks Angular Directive

I was not very happy with how the highcharts-ng, which uses its own pretty much undocumented version of chartConfig for some bizarre reason.

The directive is called Highsmorks, only to create a fun unique name.

References

I highly recommend you go through the examples and API to learn how to use chartConfig.

HighStock API - http://api.highcharts.com/highstock HighStock Demos - http://www.highcharts.com/stock/demo

HighChart API - http://api.highcharts.com/highcharts HighChart Demos - http://www.highcharts.com/demo

HTML

Setting up a chart is easy.

<highsmorks id="chart1" chart-config="{{chartConfig}}" type="StockChart"></highsmorks>

Note "chart-config" this translates to chartConfig on the angular side.

JavaScript

To setup the chart, you will need to create a chartConfig. The chartConfig I'm using is exactly the same as defined in the reference.

Here is a very simple one for example:

$scope.chartConfig = {
	title: {
		text: 'Chart Title'
	},
	subtitle: {
		text: 'Chart Subtitle'
	},
	xAxis: {
		gapGridLineWidth: 0
	},
	scrollbar: {
		enabled: false
	},
	navigator: {
		enabled: false
	},
	rangeSelector: {
		enabled: false
	},
	series : [{
		name : 'Series Name',
		data: [[1420088400000,0.89],[1388552400000,47.56],[1357016400000,39.29]],
		tooltip: {
			valueDecimals: 2
		}
	}]
};

$broadcast Methods

There is two ways to pass in data to the chartConfig or you can use a $broadcast method if you are loading the data via AJAX.

addSeries

This adds a series to a chart, the object is as defined in the HighStocks API.

$scope.$broadcast('highsmorks',{
	id: 'chart1',
	method: 'addSeries',
	obj: {
		data: [[1420088400000,0.89],[1388552400000,47.56],[1357016400000,39.29],[1325394000000,25.16],[1293858000000,7.73]],
		name: 'ytds',
		type: 'area',
		gapSize: 5,
		tooltip: {
			valueDecimals: 2,
			valueSuffix: '%'
		}
	}
});

setTitle

Sets the title and/or subtitle dynamically.

$scope.$broadcast('highsmorks',{
	id: 'chart1',
	method: 'setTitle',
	obj: {
		title: 'New Title',
		subtitle: 'New Subtitle'
	}
});

redraw

Redraws the chart.

$scope.$broadcast('highsmorks',{
	id: 'chart1',
	method: 'redraw'
});

addPoint

Adds another point to a specific series.

$scope.$broadcast('highsmorks',{
	id: 'chart1',
	method: 'addPoint',
	seriesName: 'ytds',
	obj: {
		x: 1520088400000,
		y: -25.0
	}
});

Themes

If you want all of your charts in your app to follow the same theme, you may use a theme file along with the setOptions() method.

Example:

// Global Theme for Highcharts
Highcharts.theme = {
	colors: ['#50B432', '#ED561B', '#DDDF00', '#24CBE5', '#64E572', '#FF9655', '#FFF263', '#6AF9C4'],
	credits: { enabled: false }
};
// Apply the theme with setOptions().
Highcharts.setOptions(Highcharts.theme);

Comprehensive instructions are available from highcharts directly.

http://www.highcharts.com/docs/chart-design-and-style/themes

Examples

Doughnut chart for Market Capitalization

$scope.marketCapConfig = {
	chart: {
		plotBackgroundColor: null,
		plotBorderWidth: 0,
		plotShadow: false
	},
	title: {
		text: 'Market<br/>Capitalization',
		align: 'center',
		verticalAlign: 'middle',
		y: -15
	},
	tooltip: {
		pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>'
	},
	plotOptions: {
		pie: {
			dataLabels: {
				enabled: true,
				distance: -50,
				style: {
					fontWeight: 'bold',
					color: 'white',
					textShadow: '0px 1px 2px black'
				}
			},
			startAngle: 0,
			endAngle: 360,
			center: ['50%', '50%']
		}
	},
	series: [{
		type: 'pie',
		name: 'Account Percent',
		innerSize: '50%',
		data: [
			['Small Cap',   10.38],
			['Other',       56.33],
			['Large Cap',   24.03],
			['Other',        9.26]
		]
	}]
};

Simple Line Chart

Data gets added in later by using the broadcast method addSeries above.

$scope.chartCfg = {
	title: {
		text: ''
	},
	subtitle: {
		text: ''
	},
	xAxis: {
		gapGridLineWidth: 0
	},
	scrollbar: {
		enabled: false
	},
	navigator: {
		enabled: false
	},
	rangeSelector: {
		enabled: false
	}
};

// Later after ytds data is generated from an AJAX call.
$scope.$broadcast('highsmorks',{
	id: account.number,
	method: 'addSeries',
	obj: {
		data: ytds,
		name: 'ytds',
		type: 'area',
		gapSize: 5,
		tooltip: {
			valueDecimals: 2,
			valueSuffix: '%'
		}
	}
});