Sha256: 1c684acd6bd7675c6dd55177807ac1268fa1dea868e0bbf7ae20d1ef5514d9af

Contents?: true

Size: 1021 Bytes

Versions: 39

Compression:

Stored size: 1021 Bytes

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,
		backgroundColor:'#F0F0F0',
       	colors: chart_colors,
		is3D: true
	});
}

Version data entries

39 entries across 39 versions & 1 rubygems

Version Path
old_sql-1.65.0 public/javascripts/old_sql/chart.js
old_sql-1.64.0 public/javascripts/old_sql/chart.js
old_sql-1.63.0 public/javascripts/old_sql/chart.js
old_sql-1.62.0 public/javascripts/old_sql/chart.js
old_sql-1.61.0 public/javascripts/old_sql/chart.js
old_sql-1.60.0 public/javascripts/old_sql/chart.js
old_sql-1.59.0 public/javascripts/old_sql/chart.js
old_sql-1.58.0 public/javascripts/old_sql/chart.js
old_sql-1.57.0 public/javascripts/old_sql/chart.js
old_sql-1.56.0 public/javascripts/old_sql/chart.js
old_sql-1.55.0 public/javascripts/old_sql/chart.js
old_sql-1.54.0 public/javascripts/old_sql/chart.js
old_sql-1.53.0 public/javascripts/old_sql/chart.js
old_sql-1.52.0 public/javascripts/old_sql/chart.js
old_sql-1.51.0 public/javascripts/old_sql/chart.js
old_sql-1.50.0 public/javascripts/old_sql/chart.js
old_sql-1.49.0 public/javascripts/old_sql/chart.js
old_sql-1.48.0 public/javascripts/old_sql/chart.js
old_sql-1.47.0 public/javascripts/old_sql/chart.js
old_sql-1.46.0 public/javascripts/old_sql/chart.js