first commit

This commit is contained in:
dev-chiefworks
2022-05-31 16:21:53 -04:00
commit f76abffdcd
5978 changed files with 1078901 additions and 0 deletions
@@ -0,0 +1,120 @@
/* ------------------------------------------------------------------------------
*
* # Google Visualization - candlestick
*
* Google Visualization candlestick chart demonstration
*
* Version: 1.0
* Latest update: August 1, 2015
*
* ---------------------------------------------------------------------------- */
// Candlestick chart
// ------------------------------
// Initialize chart
google.load("visualization", "1", {packages:["sankey"]});
google.setOnLoadCallback(drawCandlestick);
// Chart settings
function drawCandlestick() {
// Data
var data = google.visualization.arrayToDataTable([
['1', 20, 28, 38, 45],
['2', 31, 38, 55, 66],
['3', 50, 55, 77, 80],
['4', 77, 77, 66, 50],
['5', 68, 66, 22, 15],
['6', 12, 25, 40, 60],
['7', 10, 69, 39, 90],
['8', 18, 56, 62, 80],
['9', 10, 12, 40, 59],
['10', 30, 36, 48, 55],
['11', 78, 66, 42, 35],
['12', 32, 35, 46, 32],
['13', 65, 23, 54, 23],
['14', 60, 54, 43, 30],
['15', 12, 23, 45, 50],
['16', 4, 15, 60, 45],
['17', 5, 23, 25, 40],
['18', 90, 56, 45, 23],
['19', 65, 55, 45, 25],
['20', 43, 35, 23, 2],
['21', 12, 36, 58, 69],
['22', 18, 26, 46, 60],
['23', 60, 56, 23, 10],
['24', 45, 23, 11, 1],
['25', 4, 19, 40, 65],
['26', 50, 40, 22, 12],
['27', 67, 55, 34, 20],
['28', 4, 12, 45, 68],
['29', 34, 35, 56, 60],
['30', 53, 20, 12, 2],
['31', 25, 35, 45, 55]
// Treat first row as data as well.
], true);
// Options
var options = {
fontName: 'Roboto',
height: 400,
fontSize: 12,
chartArea: {
left: '5%',
width: '92%',
height: 350
},
colors: ['#546E7A'],
candlestick: {
risingColor: {
fill: '#546E7A',
stroke: '#546E7A'
}
},
tooltip: {
textStyle: {
fontName: 'Roboto',
fontSize: 13
}
},
vAxis: {
title: 'Income and Expenses',
titleTextStyle: {
fontSize: 13,
italic: false
},
gridlines:{
color: '#e5e5e5',
count: 10
},
minValue: 0
},
legend: 'none'
};
// Draw chart
var candlestick = new google.visualization.CandlestickChart($('#google-candlestick')[0]);
candlestick.draw(data, options);
}
// Resize chart
// ------------------------------
$(function () {
// Resize chart on sidebar width change and window resize
$(window).on('resize', resize);
$(".sidebar-control").on('click', resize);
// Resize function
function resize() {
drawCandlestick();
}
});
+114
View File
@@ -0,0 +1,114 @@
/* ------------------------------------------------------------------------------
*
* # Google Visualization - diff chart
*
* Google Visualization diff chart demonstration
*
* Version: 1.0
* Latest update: August 1, 2015
*
* ---------------------------------------------------------------------------- */
// Diff chart
// ------------------------------
// Initialize chart
google.load("visualization", "1", {packages:["corechart"]});
google.setOnLoadCallback(drawDiff);
// Chart settings
function drawDiff() {
// Old data
var oldData = google.visualization.arrayToDataTable([
['Name', 'Popularity'],
['Cesar', 425],
['Rachel', 420],
['Patrick', 290],
['Eric', 620],
['Eugene', 520],
['John', 460],
['Greg', 420],
['Matt', 410]
]);
// New data
var newData = google.visualization.arrayToDataTable([
['Name', 'Popularity'],
['Cesar', 307],
['Rachel', 360],
['Patrick', 200],
['Eric', 550],
['Eugene', 460],
['John', 320],
['Greg', 390],
['Matt', 360]
]);
// Options
var options = {
fontName: 'Roboto',
height: 400,
fontSize: 12,
chartArea: {
left: '5%',
width: '90%',
height: 350
},
colors: ['#4CAF50'],
tooltip: {
textStyle: {
fontName: 'Roboto',
fontSize: 13
}
},
vAxis: {
title: 'Popularity',
titleTextStyle: {
fontSize: 13,
italic: false
},
gridlines:{
color: '#e5e5e5',
count: 10
},
minValue: 0
},
legend: {
position: 'top',
alignment: 'end',
textStyle: {
fontSize: 12
}
}
};
// Attach chart to the DOM element
var diff = new google.visualization.ColumnChart($('#google-diff')[0]);
// Set data
var diffData = diff.computeDiff(oldData, newData);
// Draw our chart, passing in some options
diff.draw(diffData, options);
};
// Resize chart
// ------------------------------
$(function () {
// Resize chart on sidebar width change and window resize
$(window).on('resize', resize);
$(".sidebar-control").on('click', resize);
// Resize function
function resize() {
drawDiff();
}
});
+54
View File
@@ -0,0 +1,54 @@
/* ------------------------------------------------------------------------------
*
* # Google Visualization - geo chart
*
* Google Visualization geo chart demonstration
*
* Version: 1.0
* Latest update: August 1, 2015
*
* ---------------------------------------------------------------------------- */
// Geo chart
// ------------------------------
// Initialize chart
google.load("visualization", "1", {packages:["geochart"]});
google.setOnLoadCallback(drawRegionsMap);
// Chart settings
function drawRegionsMap() {
// Data
var data = google.visualization.arrayToDataTable([
['Country', 'Popularity'],
['Germany', 200],
['United States', 300],
['Brazil', 400],
['Canada', 500],
['France', 600],
['RU', 700]
]);
// Options
var options = {
fontName: 'Roboto',
height: 500,
width: "100%",
fontSize: 12,
tooltip: {
textStyle: {
fontName: 'Roboto',
fontSize: 13
}
}
};
// Draw chart
var chart = new google.visualization.GeoChart($('#google-geo-region')[0]);
chart.draw(data, options);
}
+119
View File
@@ -0,0 +1,119 @@
/* ------------------------------------------------------------------------------
*
* # Google Visualization - sankey diagram
*
* Google Visualization sankey diagram demonstration
*
* Version: 1.0
* Latest update: August 1, 2015
*
* ---------------------------------------------------------------------------- */
// Sankey diagram
// ------------------------------
// Initialize chart
google.load("visualization", "1", {packages:["sankey"]});
google.setOnLoadCallback(drawSankey);
// Chart settings
function drawSankey() {
// Data
var data = new google.visualization.DataTable();
data.addColumn('string', 'From');
data.addColumn('string', 'To');
data.addColumn('number', 'Weight');
data.addRows([
[ 'Brazil', 'Portugal', 4 ],
[ 'Brazil', 'France', 1 ],
[ 'Brazil', 'Spain', 1 ],
[ 'Brazil', 'England', 1 ],
[ 'Canada', 'Portugal', 1 ],
[ 'Canada', 'France', 4 ],
[ 'Canada', 'England', 1 ],
[ 'Mexico', 'Portugal', 1 ],
[ 'Mexico', 'France', 1 ],
[ 'Mexico', 'Spain', 4 ],
[ 'Mexico', 'England', 1 ],
[ 'USA', 'Portugal', 1 ],
[ 'USA', 'France', 1 ],
[ 'USA', 'Spain', 1 ],
[ 'USA', 'England', 4 ],
[ 'Portugal', 'Angola', 2 ],
[ 'Portugal', 'Senegal', 1 ],
[ 'Portugal', 'Morocco', 1 ],
[ 'Portugal', 'South Africa', 3 ],
[ 'France', 'Angola', 1 ],
[ 'France', 'Mali', 3 ],
[ 'France', 'Morocco', 3 ],
[ 'France', 'South Africa', 1 ],
[ 'Spain', 'Senegal', 1 ],
[ 'Spain', 'Morocco', 3 ],
[ 'Spain', 'South Africa', 1 ],
[ 'England', 'Angola', 1 ],
[ 'England', 'Senegal', 1 ],
[ 'England', 'Morocco', 2 ],
[ 'England', 'South Africa', 4 ],
[ 'South Africa', 'India', 1 ],
[ 'South Africa', 'Japan', 3 ],
[ 'Angola', 'China', 2 ],
[ 'Angola', 'India', 1 ],
[ 'Angola', 'Japan', 3 ],
[ 'Senegal', 'China', 2 ],
[ 'Senegal', 'India', 1 ],
[ 'Senegal', 'Japan', 3 ],
[ 'Mali', 'China', 2 ],
[ 'Mali', 'India', 1 ],
[ 'Mali', 'Japan', 3 ],
[ 'Morocco', 'China', 2 ],
[ 'Morocco', 'India', 1 ],
[ 'Morocco', 'Japan', 3 ],
[ 'Morocco', 'Senegal', 1 ]
]);
// Options
var options = {
height: 600,
sankey: {
link: {
color: {
fill: '#eee',
fillOpacity: 0.3
}
},
node: {
width: 8,
nodePadding: 80,
label: {
fontName: 'Roboto',
fontSize: 13
}
}
},
};
// Draw chart
var chart = new google.visualization.Sankey($('#google-sankey')[0]);
chart.draw(data, options);
}
// Resize chart
// ------------------------------
$(function () {
// Resize chart on sidebar width change and window resize
$(window).on('resize', resize);
$(".sidebar-control").on('click', resize);
// Resize function
function resize() {
drawSankey();
}
});
+106
View File
@@ -0,0 +1,106 @@
/* ------------------------------------------------------------------------------
*
* # Google Visualization - trendlines
*
* Google Visualization trendline chart demonstration
*
* Version: 1.0
* Latest update: August 1, 2015
*
* ---------------------------------------------------------------------------- */
// Trendline chart
// ------------------------------
// Initialize chart
google.load("visualization", "1", {packages:["corechart"]});
google.setOnLoadCallback(drawTrendline);
// Chart settings
function drawTrendline() {
// Data
var data = google.visualization.arrayToDataTable([
['Week', 'Bugs', 'Tests'],
[1, 175, 10],
[2, 159, 20],
[3, 126, 35],
[4, 129, 40],
[5, 108, 60],
[6, 92, 70],
[7, 55, 72],
[8, 50, 97]
]);
// Options
var options = {
fontName: 'Roboto',
height: 400,
curveType: 'function',
fontSize: 12,
chartArea: {
left: '5%',
width: '92%',
height: 350
},
hAxis: {
format: '#',
viewWindow: {min: 0, max: 9},
gridlines: {count: 10}
},
vAxis: {
title: 'Bugs and tests',
titleTextStyle: {
fontSize: 13,
italic: false
},
gridlines:{
color: '#e5e5e5',
count: 10
},
minValue: 0
},
colors: ['#6D4C41', '#FB8C00'],
trendlines: {
0: {
labelInLegend: 'Bug line',
visibleInLegend: true,
},
1: {
labelInLegend: 'Test line',
visibleInLegend: true,
}
},
legend: {
position: 'top',
alignment: 'end',
textStyle: {
fontSize: 12
}
}
};
// Draw chart
var trendline = new google.visualization.ColumnChart($('#google-trendline')[0]);
trendline.draw(data, options);
}
// Resize chart
// ------------------------------
$(function () {
// Resize chart on sidebar width change and window resize
$(window).on('resize', resize);
$(".sidebar-control").on('click', resize);
// Resize function
function resize() {
drawTrendline();
}
});