first commit
This commit is contained in:
@@ -0,0 +1,67 @@
|
||||
/* ------------------------------------------------------------------------------
|
||||
*
|
||||
* # Google Visualization - sliced 3D donut
|
||||
*
|
||||
* Google Visualization sliced 3D donut chart demonstration
|
||||
*
|
||||
* Version: 1.0
|
||||
* Latest update: August 1, 2015
|
||||
*
|
||||
* ---------------------------------------------------------------------------- */
|
||||
|
||||
|
||||
// Sliced 3D donut chart
|
||||
// ------------------------------
|
||||
|
||||
// Initialize chart
|
||||
google.load("visualization", "1", {packages:["corechart"]});
|
||||
google.setOnLoadCallback(drawExploded3d);
|
||||
|
||||
|
||||
// Chart settings
|
||||
function drawExploded3d() {
|
||||
|
||||
// Data
|
||||
var data = google.visualization.arrayToDataTable([
|
||||
['Language', 'Speakers (in millions)'],
|
||||
['Assamese', 13],
|
||||
['Bengali', 83],
|
||||
['Gujarati', 46],
|
||||
['Hindi', 90],
|
||||
['Kannada', 38],
|
||||
['Maithili', 20],
|
||||
['Malayalam', 33],
|
||||
['Marathi', 72],
|
||||
['Oriya', 33],
|
||||
['Punjabi', 29],
|
||||
['Tamil', 61],
|
||||
['Telugu', 74],
|
||||
['Urdu', 52]
|
||||
]);
|
||||
|
||||
|
||||
// Options
|
||||
var options = {
|
||||
fontName: 'Roboto',
|
||||
height: 300,
|
||||
width: 540,
|
||||
chartArea: {
|
||||
left: 50,
|
||||
width: '95%',
|
||||
height: '95%'
|
||||
},
|
||||
is3D: true,
|
||||
pieSliceText: 'label',
|
||||
slices: {
|
||||
2: {offset: 0.15},
|
||||
8: {offset: 0.1},
|
||||
10: {offset: 0.15},
|
||||
11: {offset: 0.1}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
// Instantiate and draw our chart, passing in some options.
|
||||
var pie_3d_exploded = new google.visualization.PieChart($('#google-3d-exploded')[0]);
|
||||
pie_3d_exploded.draw(data, options);
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
/* ------------------------------------------------------------------------------
|
||||
*
|
||||
* # Google Visualization - donut chart
|
||||
*
|
||||
* Google Visualization donut chart demonstration
|
||||
*
|
||||
* Version: 1.0
|
||||
* Latest update: August 1, 2015
|
||||
*
|
||||
* ---------------------------------------------------------------------------- */
|
||||
|
||||
|
||||
// Donut chart
|
||||
// ------------------------------
|
||||
|
||||
// Initialize chart
|
||||
google.load("visualization", "1", {packages:["corechart"]});
|
||||
google.setOnLoadCallback(drawDonut);
|
||||
|
||||
|
||||
// Chart settings
|
||||
function drawDonut() {
|
||||
|
||||
// Data
|
||||
var data = google.visualization.arrayToDataTable([
|
||||
['Task', 'Hours per Day'],
|
||||
['Work', 11],
|
||||
['Eat', 2],
|
||||
['Commute', 2],
|
||||
['Watch TV', 2],
|
||||
['Sleep', 7]
|
||||
]);
|
||||
|
||||
|
||||
// Options
|
||||
var options_donut = {
|
||||
fontName: 'Roboto',
|
||||
pieHole: 0.55,
|
||||
height: 300,
|
||||
width: 500,
|
||||
chartArea: {
|
||||
left: 50,
|
||||
width: '90%',
|
||||
height: '90%'
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
// Instantiate and draw our chart, passing in some options.
|
||||
var donut = new google.visualization.PieChart($('#google-donut')[0]);
|
||||
donut.draw(data, options_donut);
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
/* ------------------------------------------------------------------------------
|
||||
*
|
||||
* # Google Visualization - sliced donut
|
||||
*
|
||||
* Google Visualization sliced donut chart demonstration
|
||||
*
|
||||
* Version: 1.0
|
||||
* Latest update: August 1, 2015
|
||||
*
|
||||
* ---------------------------------------------------------------------------- */
|
||||
|
||||
|
||||
// Sliced donut chart
|
||||
// ------------------------------
|
||||
|
||||
// Initialize chart
|
||||
google.load("visualization", "1", {packages:["corechart"]});
|
||||
google.setOnLoadCallback(drawExplodedDonut);
|
||||
|
||||
|
||||
// Chart settings
|
||||
function drawExplodedDonut() {
|
||||
|
||||
// Data
|
||||
var data = google.visualization.arrayToDataTable([
|
||||
['Language', 'Speakers (in millions)'],
|
||||
['Assamese', 13],
|
||||
['Bengali', 83],
|
||||
['Gujarati', 46],
|
||||
['Hindi', 90],
|
||||
['Kannada', 38],
|
||||
['Maithili', 20],
|
||||
['Malayalam', 33],
|
||||
['Marathi', 72],
|
||||
['Oriya', 33],
|
||||
['Punjabi', 29],
|
||||
['Tamil', 61],
|
||||
['Telugu', 74],
|
||||
['Urdu', 52]
|
||||
]);
|
||||
|
||||
|
||||
// Options
|
||||
var options_donut_exploded = {
|
||||
fontName: 'Roboto',
|
||||
height: 300,
|
||||
width: 540,
|
||||
chartArea: {
|
||||
left: 50,
|
||||
width: '90%',
|
||||
height: '90%'
|
||||
},
|
||||
pieHole: 0.5,
|
||||
pieSliceText: 'label',
|
||||
slices: {
|
||||
2: {offset: 0.15},
|
||||
8: {offset: 0.1},
|
||||
10: {offset: 0.15},
|
||||
11: {offset: 0.1}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
// Instantiate and draw our chart, passing in some options.
|
||||
var donut_exploded = new google.visualization.PieChart($('#google-donut-exploded')[0]);
|
||||
donut_exploded.draw(data, options_donut_exploded);
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
/* ------------------------------------------------------------------------------
|
||||
*
|
||||
* # Google Visualization - rotated donut
|
||||
*
|
||||
* Google Visualization rotated donut chart demonstration
|
||||
*
|
||||
* Version: 1.0
|
||||
* Latest update: August 1, 2015
|
||||
*
|
||||
* ---------------------------------------------------------------------------- */
|
||||
|
||||
|
||||
// Rotated donut chart
|
||||
// ------------------------------
|
||||
|
||||
// Initialize chart
|
||||
google.load("visualization", "1", {packages:["corechart"]});
|
||||
google.setOnLoadCallback(drawDonutRotated);
|
||||
|
||||
|
||||
// Chart settings
|
||||
function drawDonutRotated() {
|
||||
|
||||
// Data
|
||||
var data = google.visualization.arrayToDataTable([
|
||||
['Task', 'Hours per Day'],
|
||||
['Work', 11],
|
||||
['Eat', 2],
|
||||
['Commute', 2],
|
||||
['Watch TV', 2],
|
||||
['Sleep', 7]
|
||||
]);
|
||||
|
||||
|
||||
// Options
|
||||
var options_donut_rotate = {
|
||||
fontName: 'Roboto',
|
||||
pieHole: 0.55,
|
||||
pieStartAngle: 180,
|
||||
height: 300,
|
||||
width: 500,
|
||||
chartArea: {
|
||||
left: 50,
|
||||
width: '90%',
|
||||
height: '90%'
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
// Instantiate and draw our chart, passing in some options.
|
||||
var donut_rotate = new google.visualization.PieChart($('#google-donut-rotate')[0]);
|
||||
donut_rotate.draw(data, options_donut_rotate);
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
/* ------------------------------------------------------------------------------
|
||||
*
|
||||
* # Google Visualization - pie chart
|
||||
*
|
||||
* Google Visualization pie chart demonstration
|
||||
*
|
||||
* Version: 1.0
|
||||
* Latest update: August 1, 2015
|
||||
*
|
||||
* ---------------------------------------------------------------------------- */
|
||||
|
||||
|
||||
// Pie chart
|
||||
// ------------------------------
|
||||
|
||||
// Initialize chart
|
||||
google.load("visualization", "1", {packages:["corechart"]});
|
||||
google.setOnLoadCallback(drawPie);
|
||||
|
||||
|
||||
// Chart settings
|
||||
function drawPie() {
|
||||
|
||||
// Data
|
||||
var data = google.visualization.arrayToDataTable([
|
||||
['Task', 'Hours per Day'],
|
||||
['Work', 11],
|
||||
['Eat', 2],
|
||||
['Commute', 2],
|
||||
['Watch TV', 2],
|
||||
['Sleep', 7]
|
||||
]);
|
||||
|
||||
// Options
|
||||
var options_pie = {
|
||||
fontName: 'Roboto',
|
||||
height: 300,
|
||||
width: 500,
|
||||
chartArea: {
|
||||
left: 50,
|
||||
width: '90%',
|
||||
height: '90%'
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
// Instantiate and draw our chart, passing in some options.
|
||||
var pie = new google.visualization.PieChart($('#google-pie')[0]);
|
||||
pie.draw(data, options_pie);
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
/* ------------------------------------------------------------------------------
|
||||
*
|
||||
* # Google Visualization - 3D pie
|
||||
*
|
||||
* Google Visualization 3D pie chart demonstration
|
||||
*
|
||||
* Version: 1.0
|
||||
* Latest update: August 1, 2015
|
||||
*
|
||||
* ---------------------------------------------------------------------------- */
|
||||
|
||||
|
||||
// 3D pie chart
|
||||
// ------------------------------
|
||||
|
||||
// Initialize chart
|
||||
google.load("visualization", "1", {packages:["corechart"]});
|
||||
google.setOnLoadCallback(drawPie3d);
|
||||
|
||||
|
||||
// Chart settings
|
||||
function drawPie3d() {
|
||||
|
||||
// Data
|
||||
var data = google.visualization.arrayToDataTable([
|
||||
['Task', 'Hours per Day'],
|
||||
['Work', 11],
|
||||
['Eat', 2],
|
||||
['Commute', 2],
|
||||
['Watch TV', 2],
|
||||
['Sleep', 7]
|
||||
]);
|
||||
|
||||
|
||||
// Options
|
||||
var options_pie_3d = {
|
||||
fontName: 'Roboto',
|
||||
is3D: true,
|
||||
height: 300,
|
||||
width: 540,
|
||||
chartArea: {
|
||||
left: 50,
|
||||
width: '95%',
|
||||
height: '95%'
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
// Instantiate and draw our chart, passing in some options.
|
||||
var pie_3d = new google.visualization.PieChart($('#google-pie-3d')[0]);
|
||||
pie_3d.draw(data, options_pie_3d);
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
/* ------------------------------------------------------------------------------
|
||||
*
|
||||
* # Google Visualization - diff pie
|
||||
*
|
||||
* Google Visualization diff pie chart with border factor demonstration
|
||||
*
|
||||
* Version: 1.0
|
||||
* Latest update: August 1, 2015
|
||||
*
|
||||
* ---------------------------------------------------------------------------- */
|
||||
|
||||
|
||||
// Diff pie chart
|
||||
// ------------------------------
|
||||
|
||||
// Initialize chart
|
||||
google.load("visualization", '1.1', {packages:['corechart']});
|
||||
google.setOnLoadCallback(drawChart);
|
||||
|
||||
|
||||
// Chart settings
|
||||
function drawChart() {
|
||||
|
||||
// Old data set
|
||||
var oldData = google.visualization.arrayToDataTable([
|
||||
['Major', 'Degrees'],
|
||||
['Business', 256070], ['Education', 108034],
|
||||
['Social Sciences & History', 127101], ['Health', 81863],
|
||||
['Psychology', 74194]
|
||||
]);
|
||||
|
||||
// New data set
|
||||
var newData = google.visualization.arrayToDataTable([
|
||||
['Major', 'Degrees'],
|
||||
['Business', 358293], ['Education', 101265],
|
||||
['Social Sciences & History', 172780], ['Health', 129634],
|
||||
['Psychology', 97216]
|
||||
]);
|
||||
|
||||
|
||||
// Options
|
||||
var options = {
|
||||
fontName: 'Roboto',
|
||||
height: 300,
|
||||
width: 500,
|
||||
chartArea: {
|
||||
left: 50,
|
||||
width: '90%',
|
||||
height: '90%'
|
||||
},
|
||||
diff: {
|
||||
innerCircle: {
|
||||
borderFactor: 0.08
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
// Attach chart to the DOM element
|
||||
var chartRadius = new google.visualization.PieChart($('#google-pie-diff-border')[0]);
|
||||
|
||||
// Set data
|
||||
var diffData = chartRadius.computeDiff(oldData, newData);
|
||||
|
||||
// Draw our chart, passing in some options
|
||||
chartRadius.draw(diffData, options);
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
/* ------------------------------------------------------------------------------
|
||||
*
|
||||
* # Google Visualization - diff pie
|
||||
*
|
||||
* Google Visualization diff pie chart with inverted behaviour demonstration
|
||||
*
|
||||
* Version: 1.0
|
||||
* Latest update: August 1, 2015
|
||||
*
|
||||
* ---------------------------------------------------------------------------- */
|
||||
|
||||
|
||||
// Diff pie chart
|
||||
// ------------------------------
|
||||
|
||||
// Initialize chart
|
||||
google.load("visualization", '1.1', {packages:['corechart']});
|
||||
google.setOnLoadCallback(drawChart);
|
||||
|
||||
|
||||
// Chart settings
|
||||
function drawChart() {
|
||||
|
||||
// Old data
|
||||
var oldData = google.visualization.arrayToDataTable([
|
||||
['Major', 'Degrees'],
|
||||
['Business', 256070], ['Education', 108034],
|
||||
['Social Sciences & History', 127101], ['Health', 81863],
|
||||
['Psychology', 74194]
|
||||
]);
|
||||
|
||||
// New data
|
||||
var newData = google.visualization.arrayToDataTable([
|
||||
['Major', 'Degrees'],
|
||||
['Business', 358293], ['Education', 101265],
|
||||
['Social Sciences & History', 172780], ['Health', 129634],
|
||||
['Psychology', 97216]
|
||||
]);
|
||||
|
||||
|
||||
// Options
|
||||
var options = {
|
||||
fontName: 'Roboto',
|
||||
height: 300,
|
||||
width: 500,
|
||||
chartArea: {
|
||||
left: 50,
|
||||
width: '90%',
|
||||
height: '90%'
|
||||
},
|
||||
diff: {
|
||||
oldData: {
|
||||
inCenter: false
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
// Attach chart to the DOM element
|
||||
var chartRadius = new google.visualization.PieChart($('#google-pie-diff-invert')[0]);
|
||||
|
||||
// Set data
|
||||
var diffData = chartRadius.computeDiff(oldData, newData);
|
||||
|
||||
// Draw our chart, passing in some options
|
||||
chartRadius.draw(diffData, options);
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
/* ------------------------------------------------------------------------------
|
||||
*
|
||||
* # Google Visualization - diff pie
|
||||
*
|
||||
* Google Visualization diff pie chart with transparency demonstration
|
||||
*
|
||||
* Version: 1.0
|
||||
* Latest update: August 1, 2015
|
||||
*
|
||||
* ---------------------------------------------------------------------------- */
|
||||
|
||||
|
||||
// Diff pie chart
|
||||
// ------------------------------
|
||||
|
||||
// Initialize chart
|
||||
google.load("visualization", '1.1', {packages:['corechart']});
|
||||
google.setOnLoadCallback(drawChart);
|
||||
|
||||
|
||||
// Chart settings
|
||||
function drawChart() {
|
||||
|
||||
// Old data
|
||||
var oldData = google.visualization.arrayToDataTable([
|
||||
['Major', 'Degrees'],
|
||||
['Business', 256070], ['Education', 108034],
|
||||
['Social Sciences & History', 127101], ['Health', 81863],
|
||||
['Psychology', 74194]
|
||||
]);
|
||||
|
||||
// New data
|
||||
var newData = google.visualization.arrayToDataTable([
|
||||
['Major', 'Degrees'],
|
||||
['Business', 358293], ['Education', 101265],
|
||||
['Social Sciences & History', 172780], ['Health', 129634],
|
||||
['Psychology', 97216]
|
||||
]);
|
||||
|
||||
|
||||
// Options
|
||||
var options = {
|
||||
fontName: 'Roboto',
|
||||
height: 300,
|
||||
width: 500,
|
||||
chartArea: {
|
||||
left: 50,
|
||||
width: '90%',
|
||||
height: '90%'
|
||||
},
|
||||
diff: {
|
||||
oldData: {
|
||||
opacity: 0.8
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
// Attach chart to the DOM element
|
||||
var chartRadius = new google.visualization.PieChart($('#google-pie-diff-opacity')[0]);
|
||||
|
||||
// Set data
|
||||
var diffData = chartRadius.computeDiff(oldData, newData);
|
||||
|
||||
// Draw our chart, passing in some options
|
||||
chartRadius.draw(diffData, options);
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
/* ------------------------------------------------------------------------------
|
||||
*
|
||||
* # Google Visualization - diff pie
|
||||
*
|
||||
* Google Visualization diff pie chart with radius factor demonstration
|
||||
*
|
||||
* Version: 1.0
|
||||
* Latest update: August 1, 2015
|
||||
*
|
||||
* ---------------------------------------------------------------------------- */
|
||||
|
||||
|
||||
// Diff pie chart
|
||||
// ------------------------------
|
||||
|
||||
// Initialize chart
|
||||
google.load("visualization", '1.1', {packages:['corechart']});
|
||||
google.setOnLoadCallback(drawChart);
|
||||
|
||||
|
||||
// Chart settings
|
||||
function drawChart() {
|
||||
|
||||
// Old data
|
||||
var oldData = google.visualization.arrayToDataTable([
|
||||
['Major', 'Degrees'],
|
||||
['Business', 256070], ['Education', 108034],
|
||||
['Social Sciences & History', 127101], ['Health', 81863],
|
||||
['Psychology', 74194]
|
||||
]);
|
||||
|
||||
// New data
|
||||
var newData = google.visualization.arrayToDataTable([
|
||||
['Major', 'Degrees'],
|
||||
['Business', 358293], ['Education', 101265],
|
||||
['Social Sciences & History', 172780], ['Health', 129634],
|
||||
['Psychology', 97216]
|
||||
]);
|
||||
|
||||
|
||||
// Options
|
||||
var options = {
|
||||
fontName: 'Roboto',
|
||||
height: 300,
|
||||
width: 500,
|
||||
chartArea: {
|
||||
left: 50,
|
||||
width: '90%',
|
||||
height: '90%'
|
||||
},
|
||||
diff: {
|
||||
innerCircle: {
|
||||
radiusFactor: 0.8
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
// Attach chart to the DOM element
|
||||
var chartRadius = new google.visualization.PieChart($('#google-pie-diff-radius')[0]);
|
||||
|
||||
// Set data
|
||||
var diffData = chartRadius.computeDiff(oldData, newData);
|
||||
|
||||
// Draw our chart, passing in some options
|
||||
chartRadius.draw(diffData, options);
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
/* ------------------------------------------------------------------------------
|
||||
*
|
||||
* # Google Visualization - sliced pie
|
||||
*
|
||||
* Google Visualization sliced pie chart demonstration
|
||||
*
|
||||
* Version: 1.0
|
||||
* Latest update: August 1, 2015
|
||||
*
|
||||
* ---------------------------------------------------------------------------- */
|
||||
|
||||
|
||||
// Sliced pie chart
|
||||
// ------------------------------
|
||||
|
||||
// Initialize chart
|
||||
google.load("visualization", "1", {packages:["corechart"]});
|
||||
google.setOnLoadCallback(drawExplodedPie);
|
||||
|
||||
|
||||
// Chart settings
|
||||
function drawExplodedPie() {
|
||||
|
||||
// Data
|
||||
var data = google.visualization.arrayToDataTable([
|
||||
['Language', 'Speakers (in millions)'],
|
||||
['Assamese', 13],
|
||||
['Bengali', 83],
|
||||
['Gujarati', 46],
|
||||
['Hindi', 90],
|
||||
['Kannada', 38],
|
||||
['Maithili', 20],
|
||||
['Malayalam', 33],
|
||||
['Marathi', 72],
|
||||
['Oriya', 33],
|
||||
['Punjabi', 29],
|
||||
['Tamil', 61],
|
||||
['Telugu', 74],
|
||||
['Urdu', 52]
|
||||
]);
|
||||
|
||||
|
||||
// Options
|
||||
var options = {
|
||||
fontName: 'Roboto',
|
||||
height: 300,
|
||||
width: 540,
|
||||
chartArea: {
|
||||
left: 50,
|
||||
width: '90%',
|
||||
height: '90%'
|
||||
},
|
||||
pieSliceText: 'label',
|
||||
slices: {
|
||||
2: {offset: 0.15},
|
||||
8: {offset: 0.1},
|
||||
10: {offset: 0.15},
|
||||
11: {offset: 0.1}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
// Instantiate and draw our chart, passing in some options.
|
||||
var pie_exploded = new google.visualization.PieChart($('#google-pie-exploded')[0]);
|
||||
pie_exploded.draw(data, options);
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
/* ------------------------------------------------------------------------------
|
||||
*
|
||||
* # Google Visualization - rotated pie
|
||||
*
|
||||
* Google Visualization rotated pie chart demonstration
|
||||
*
|
||||
* Version: 1.0
|
||||
* Latest update: August 1, 2015
|
||||
*
|
||||
* ---------------------------------------------------------------------------- */
|
||||
|
||||
|
||||
// Rotated pie chart
|
||||
// ------------------------------
|
||||
|
||||
// Initialize chart
|
||||
google.load("visualization", "1", {packages:["corechart"]});
|
||||
google.setOnLoadCallback(drawPieRotated);
|
||||
|
||||
|
||||
// Chart settings
|
||||
function drawPieRotated() {
|
||||
|
||||
// Data
|
||||
var data = google.visualization.arrayToDataTable([
|
||||
['Task', 'Hours per Day'],
|
||||
['Work', 11],
|
||||
['Eat', 2],
|
||||
['Commute', 2],
|
||||
['Watch TV', 2],
|
||||
['Sleep', 7]
|
||||
]);
|
||||
|
||||
|
||||
// Options
|
||||
var options_pie_rotate = {
|
||||
fontName: 'Roboto',
|
||||
pieStartAngle: 180,
|
||||
height: 300,
|
||||
width: 500,
|
||||
chartArea: {
|
||||
left: 50,
|
||||
width: '90%',
|
||||
height: '90%'
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
// Instantiate and draw our chart, passing in some options.
|
||||
var pie_rotate = new google.visualization.PieChart($('#google-pie-rotate')[0]);
|
||||
pie_rotate.draw(data, options_pie_rotate);
|
||||
}
|
||||
Reference in New Issue
Block a user