-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
127 changed files
with
1,960 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<script defer src="./index.ts"></script> | ||
</head> | ||
<body> | ||
<div id="chart" style="height: 50vh"></div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import 'chartist/dist/index.css'; | ||
import { BarChart, BarChartOptions } from 'chartist'; | ||
|
||
const data = { | ||
labels: ['W1', 'W2', 'W3', 'W4', 'W5', 'W6', 'W7', 'W8', 'W9', 'W10'], | ||
series: [[1, 2, 4, 8, 6, -2, -1, -4, -6, -2]] | ||
}; | ||
|
||
const options: BarChartOptions = { | ||
high: 10, | ||
low: -10, | ||
axisX: { | ||
labelInterpolationFnc(value, index) { | ||
return index % 2 === 0 ? value : null; | ||
} | ||
} | ||
}; | ||
|
||
new BarChart('#chart', data, options); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"name": "bar-bi-polar-interpolated", | ||
"description": "Bi-polar bar chart", | ||
"main": "index.ts", | ||
"dependencies": { | ||
"chartist": "^1.0.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"infiniteLoopProtection": true, | ||
"hardReloadOnChange": true, | ||
"view": "browser", | ||
"template": "parcel" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<script defer src="./index.ts"></script> | ||
</head> | ||
<body> | ||
<div id="chart" style="height: 50vh"></div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import 'chartist/dist/index.css'; | ||
import { BarChart } from 'chartist'; | ||
|
||
new BarChart( | ||
'#chart', | ||
{ | ||
labels: ['XS', 'S', 'M', 'L', 'XL', 'XXL', 'XXXL'], | ||
series: [20, 60, 120, 200, 180, 20, 10] | ||
}, | ||
{ | ||
distributeSeries: true | ||
} | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"name": "bar-distributed-series", | ||
"description": "Distributed series", | ||
"main": "index.ts", | ||
"dependencies": { | ||
"chartist": "^1.0.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"infiniteLoopProtection": true, | ||
"hardReloadOnChange": true, | ||
"view": "browser", | ||
"template": "parcel" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<script defer src="./index.ts"></script> | ||
</head> | ||
<body> | ||
<div id="chart" style="height: 50vh"></div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
import 'chartist/dist/index.css'; | ||
import { BarChart, noop } from 'chartist'; | ||
|
||
new BarChart( | ||
'#chart', | ||
{ | ||
labels: ['Quarter 1', 'Quarter 2', 'Quarter 3', 'Quarter 4'], | ||
series: [ | ||
[5, 4, 3, 7], | ||
[3, 2, 9, 5], | ||
[1, 5, 8, 4], | ||
[2, 3, 4, 6], | ||
[4, 1, 2, 1] | ||
] | ||
}, | ||
{ | ||
// Default mobile configuration | ||
stackBars: true, | ||
axisX: { | ||
labelInterpolationFnc: value => | ||
String(value) | ||
.split(/\s+/) | ||
.map(word => word[0]) | ||
.join('') | ||
}, | ||
axisY: { | ||
offset: 20 | ||
} | ||
}, | ||
[ | ||
// Options override for media > 400px | ||
[ | ||
'screen and (min-width: 400px)', | ||
{ | ||
reverseData: true, | ||
horizontalBars: true, | ||
axisX: { | ||
labelInterpolationFnc: noop | ||
}, | ||
axisY: { | ||
offset: 60 | ||
} | ||
} | ||
], | ||
// Options override for media > 800px | ||
[ | ||
'screen and (min-width: 800px)', | ||
{ | ||
stackBars: false, | ||
seriesBarDistance: 10 | ||
} | ||
], | ||
// Options override for media > 1000px | ||
[ | ||
'screen and (min-width: 1000px)', | ||
{ | ||
reverseData: false, | ||
horizontalBars: false, | ||
seriesBarDistance: 15 | ||
} | ||
] | ||
] | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"name": "bar-extreme-responsive", | ||
"description": "Extreme responsive configuration", | ||
"main": "index.ts", | ||
"dependencies": { | ||
"chartist": "^1.0.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"infiniteLoopProtection": true, | ||
"hardReloadOnChange": true, | ||
"view": "browser", | ||
"template": "parcel" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<script defer src="./index.ts"></script> | ||
</head> | ||
<body> | ||
<div id="chart" style="height: 50vh"></div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import 'chartist/dist/index.css'; | ||
import { BarChart } from 'chartist'; | ||
|
||
new BarChart( | ||
'#chart', | ||
{ | ||
labels: [ | ||
'Monday', | ||
'Tuesday', | ||
'Wednesday', | ||
'Thursday', | ||
'Friday', | ||
'Saturday', | ||
'Sunday' | ||
], | ||
series: [ | ||
[5, 4, 3, 7, 5, 10, 3], | ||
[3, 2, 9, 5, 4, 6, 4] | ||
] | ||
}, | ||
{ | ||
seriesBarDistance: 10, | ||
reverseData: true, | ||
horizontalBars: true, | ||
axisY: { | ||
offset: 70 | ||
} | ||
} | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"name": "bar-horizontal", | ||
"description": "Horizontal bar chart", | ||
"main": "index.ts", | ||
"dependencies": { | ||
"chartist": "^1.0.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"infiniteLoopProtection": true, | ||
"hardReloadOnChange": true, | ||
"view": "browser", | ||
"template": "parcel" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<script defer src="./index.ts"></script> | ||
</head> | ||
<body> | ||
<div id="chart" style="height: 50vh"></div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import 'chartist/dist/index.css'; | ||
import { BarChart } from 'chartist'; | ||
|
||
new BarChart( | ||
'#chart', | ||
{ | ||
labels: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'], | ||
series: [ | ||
[5, 4, 3, 7, 5, 10, 3], | ||
[3, 2, 9, 5, 4, 6, 4] | ||
] | ||
}, | ||
{ | ||
axisX: { | ||
// On the x-axis start means top and end means bottom | ||
position: 'start' | ||
}, | ||
axisY: { | ||
// On the y-axis start means left and end means right | ||
position: 'end' | ||
} | ||
} | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"name": "bar-label-position", | ||
"description": "Label placement", | ||
"main": "index.ts", | ||
"dependencies": { | ||
"chartist": "^1.0.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"infiniteLoopProtection": true, | ||
"hardReloadOnChange": true, | ||
"view": "browser", | ||
"template": "parcel" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<script defer src="./index.ts"></script> | ||
</head> | ||
<body> | ||
<div id="chart" style="height: 50vh"></div> | ||
</body> | ||
</html> |
Oops, something went wrong.