Sha256: 7684d793ddcd5c1dc87a2b4d5655147eada81447b67e2f40b8ebd0183363ce84

Contents?: true

Size: 1.2 KB

Versions: 5

Compression:

Stored size: 1.2 KB

Contents

var chart = null;

// Load the Visualization API and the piechart package.
google.load('visualization', '1', {'packages':['corechart']});

// Set a callback to run when the Google Visualization API is loaded.
google.setOnLoadCallback(drawChart);

// Callback that creates and populates a data table, 
// instantiates the pie chart, passes in the data and
// draws it.
function drawChart() {
	// Create our data table.
	var data = new google.visualization.DataTable();
	data.addColumn('string', 'Title');
	data.addColumn('number', 'Data');
	data.addRows(chart_data);

	// Instantiate and draw our chart, passing in some options.
	if (chart_type=='pie') {
		var chart = new google.visualization.PieChart(document.getElementById('chart_div'));
	} else if (chart_type=='bar') {
		var chart = new google.visualization.BarChart(document.getElementById('chart_div'));
	}
	
	chart.draw(data, {
		width: width, 
		height: height,
		title:chart_title,
       	colors:['#E35F18','#307CC7','#D95117','#0A4592','#B33A13','#073D8D','#902811','#052D79','#7A1904','#061E59','#6E0E02','#071253','#530005','#1F3058','#2A437F','#3657A8','#5675BB','#7A94CC','#F38200','#C4794B','#BF5D29','#B8410B','#AD3300','#802205','#36170F'],
		is3D: true
	});
}

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
old_sql-1.21.0 public/javascripts/old_sql/chart.js
old_sql-1.20.0 public/javascripts/old_sql/chart.js
old_sql-1.19.0 public/javascripts/old_sql/chart.js
old_sql-1.18.0 public/javascripts/old_sql/chart.js
old_sql-1.17.0 public/javascripts/old_sql/chart.js