Skip to content

Commit e18bd51

Browse files
authored
Merge pull request #13 from uvarc/workshop-visualization
style departments like main page
2 parents 41deebf + f3d270d commit e18bd51

File tree

2 files changed

+29
-13
lines changed

2 files changed

+29
-13
lines changed

public/html/workshops/departments.html

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,19 @@
1111
<body>
1212
<main>
1313
<div id="main-container">
14-
<div id="charts"></div>
14+
<div id="header">
15+
<h1>RC Workshops by Department Data Visualization</h1>
16+
<p>
17+
This page visualizes data from RC workshops. You can filter workshops using the options on the right
18+
and create multiple charts to compare different sets of workshops. Hover over chart elements to see
19+
details.
20+
</p>
21+
</div>
22+
<div id="charts-outer-wrapper">
23+
<div id="charts-wrapper">
24+
<div id="charts"></div>
25+
</div>
26+
</div>
1527
<div id="legend">
1628
<ul class="legend-list">
1729
</ul>

public/html/workshops/departments.js

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,8 @@ function createChart(data, ctxId) {
175175
charts[ctxId].destroy();
176176
}
177177

178+
document.getElementById('charts-wrapper').style.width = (data.length * 100 + 200) + 'px';
179+
178180
const firstDate = new Date(data[0].start);
179181
const lastDate = new Date(data[data.length - 1].end);
180182

@@ -192,12 +194,12 @@ function createChart(data, ctxId) {
192194

193195
const departmentColors = {};
194196
const colorPalette = [
195-
'#FF6633', '#FFB399', '#FF33FF', '#FFFF99', '#00B3E6',
196-
'#E6B333', '#3366E6', '#999966', '#99FF99', '#B34D4D',
197-
'#80B300', '#809900', '#E6B3B3', '#6680B3', '#66991A',
198-
'#FF99E6', '#CCFF1A', '#FF1A66', '#E6331A', '#33FFCC',
199-
'#66994D', '#B366CC', '#4D8000', '#B33300', '#CC80CC',
200-
'#66664D', '#991AFF', '#E666FF', '#4DB3FF', '#1AB399',
197+
'#FF6633', '#FFB399', '#FF33FF', '#00B3E6', '#3366E6',
198+
'#999966', '#99FF99', '#B34D4D', '#80B300', '#E6B3B3',
199+
'#6680B3', '#66991A', '#FF99E6', '#CCFF1A', '#FF1A66',
200+
'#E6331A', '#33FFCC', '#66994D', '#B366CC', '#4D8000',
201+
'#B33300', '#CC80CC', '#66664D', '#991AFF', '#E666FF',
202+
'#4DB3FF', '#1AB399',
201203
];
202204

203205
departments.forEach((dept, index) => {
@@ -282,13 +284,15 @@ function createChart(data, ctxId) {
282284
}
283285
}, ChartDataLabels],
284286
options: {
287+
responsive: true,
288+
maintainAspectRatio: false,
285289
interaction: {
286290
mode: 'index'
287291
},
288292
layout: {
289-
padding: {
290-
bottom: 80
291-
}
293+
// padding: {
294+
// bottom: 80
295+
// }
292296
},
293297
plugins: {
294298
datalabels: {
@@ -301,7 +305,7 @@ function createChart(data, ctxId) {
301305
}
302306
},
303307
title: {
304-
display: true,
308+
display: false,
305309
text: `RC Workshops ${dateToSemester(firstDate)}${dateToSemester(lastDate)}`,
306310
font: {
307311
size: 25
@@ -343,8 +347,8 @@ function createChart(data, ctxId) {
343347
stacked: true,
344348
ticks: {
345349
autoSkip: false,
346-
maxRotation: 90,
347-
minRotation: 60,
350+
// maxRotation: 90,
351+
// minRotation: 60,
348352
}
349353
},
350354
y: {

0 commit comments

Comments
 (0)