Sha256: e562210e05556a6596fbee19b6ead89308061ef31fc77328de1d4c5bfe83b497

Contents?: true

Size: 1.47 KB

Versions: 8

Compression:

Stored size: 1.47 KB

Contents

var Report = {};
Report.plot = function(selector, projects){  
  var sources = [], specs = [], labels = [];
  for(var i = 0; i < projects.length; i++){
    var project = projects[i];
    labels.push(project[0]);
    sources.push(project[1]);
    specs.push(project[2]);
  }
    
	var chart = new Highcharts.Chart({
		chart: {
			renderTo: 'plot',
			defaultSeriesType: 'column'
		},
		title: {
			text: null // 'Stacked column chart'
		},
		xAxis: {
			categories: labels,
			labels: {
			  rotation: -45, 
			  align: 'right'
			}
		},
		yAxis: {
			min: 0,
			title: {
				text: 'Characters Count'
			},
			stackLabels: {
				enabled: true,
				style: {
					fontWeight: 'bold',
					color: (Highcharts.theme && Highcharts.theme.textColor) || 'gray'
				}
			}
		},
		legend: {
			align: 'right',
			x: -100,
			verticalAlign: 'top',
			y: 20,
			floating: true,
			backgroundColor: (Highcharts.theme && Highcharts.theme.legendBackgroundColorSolid) || 'white',
			borderColor: '#CCC',
			borderWidth: 1,
			shadow: false
		},
		tooltip: {
			formatter: function() {
				return '<b>'+ this.x +'</b><br/>'+
					 this.series.name +': '+ this.y +'<br/>'+
					 'Total: '+ this.point.stackTotal;
			}
		},
		plotOptions: {
			column: {
				stacking: 'normal',
				dataLabels: {
					enabled: true,
					color: (Highcharts.theme && Highcharts.theme.dataLabelsColor) || 'white'
				}
			}
		},		
    series: [{
      name: 'Specs',
			data: specs			
		}, {			
		  name: 'Sources',
			data: sources
		}]
	});

};

Version data entries

8 entries across 8 versions & 3 rubygems

Version Path
code_stats2-0.1.6 lib/code_stats/report/report.js
code_stats2-0.1.5 lib/code_stats/report/report.js
code_stats2-0.1.4 lib/code_stats/report/report.js
code_stats2-0.1.3 lib/code_stats/report/report.js
code_stats2-0.1.2 lib/code_stats/report/report.js
code_stats2-0.1.1 lib/code_stats/report/report.js
code-statistics-0.1.1 lib/code_stats/report/report.js
code-stats-0.1.1 lib/code_stats/report/report.js