Skip to content

Instantly share code, notes, and snippets.

View samarthagarwal's full-sized avatar
🎯
Focusing

Samarth Agarwal samarthagarwal

🎯
Focusing
View GitHub Profile
<script src="https://code.highcharts.com/highcharts.js"></script>
<script src="https://code.highcharts.com/highcharts.js"></script>
<div id="container" style="display: block;"></div>
@samarthagarwal
samarthagarwal / app.js
Created February 8, 2018 12:11
ACWA-03
var myChart = Highcharts.chart('container', {
chart: {
type: 'bar'
},
title: {
text: 'Fruit Consumption'
},
xAxis: {
categories: ['Apples', 'Bananas', 'Oranges']
},
@samarthagarwal
samarthagarwal / app.js
Created February 8, 2018 12:12
ACWA-04
Highcharts.chart('container', {
chart: {
type: 'pie'
},
title: {
text: 'Browser market shares January, 2017 to Decmber, 2017'
},
tooltip: {
pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>'
},
@samarthagarwal
samarthagarwal / app.js
Created February 8, 2018 12:14
ACWA-05
series: [
{
name: "Browsers",
data: [
{
name: "MSIE",
y: 10,
color: colors[0]
},
{
@samarthagarwal
samarthagarwal / app.js
Created February 8, 2018 12:15
ACWA-06
var colors = Highcharts.getOptions().colors;
@samarthagarwal
samarthagarwal / app.js
Created February 8, 2018 12:16
ACWA-07
{
name: "Versions",
data: [
{ name: "MSIE 6.0", y: 0.5, color: colors[0] },
{ name: "MSIE 7.0", y: 1.5, color: colors[0] },
{ name: "MSIE 8.0", y: 2, color: colors[0] },
{ name: "MSIE 9.0", y: 2, color: colors[0] },
{ name: "MSIE 10.0", y: 2, color: colors[0] },
{ name: "MSIE 11.0", y: 2, color: colors[0] },
{ name: "Firefox v31", y: 1, color: colors[1] },
@samarthagarwal
samarthagarwal / app.js
Created February 8, 2018 12:17
ACWA-08
var dataset1 = [];
var dataset2 = [];
for (var i = 0; i < 16; i++) {
dataset1.push(Math.floor(Math.random() * 10 + 1));
dataset2.push(Math.floor(Math.random() * 10 + 1));
}
@samarthagarwal
samarthagarwal / app.js
Created February 8, 2018 12:18
ACWA-09
var myChart = Highcharts.chart("container", {
chart: {
type: "spline"
},
title: {
text: "Crypto - Rates"
},
yAxis: {
title: {
text: "Currency Rates"
@samarthagarwal
samarthagarwal / app.js
Created February 8, 2018 12:19
ACWA-10
var index = 0;
setInterval(() => {
myChart.series[0].addPoint(Math.floor(Math.random() * 10 + 1), false, true);
myChart.series[1].addPoint(Math.floor(Math.random() * 10 + 1), true, true);
index++;
}, 2000);