Skip to content

Commit

Permalink
Improve chart tooltips slightly
Browse files Browse the repository at this point in the history
Closes #28 though they're still not perfect at all
  • Loading branch information
Botffy committed Jul 29, 2021
1 parent b45ca60 commit 28f5d24
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 5 deletions.
22 changes: 21 additions & 1 deletion src/Bikes.vue
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,17 @@ export default Vue.extend({
text: 'Bicajok'
}
},
xAxis: {
title: {
text: 'A bicajjal megtett utak száma'
}
},
tooltip: {
headerFormat: '<span style="font-size:10px">{point.key} út</span><table>',
pointFormat: '<tr><td style="padding:0"><b>{point.y:.0f} bicaj</b></td></tr>',
footerFormat: '</table>',
useHTML: true
},
credits: {
enabled: false
},
Expand Down Expand Up @@ -163,7 +174,16 @@ export default Vue.extend({
xAxis: {
categories: this.bikeByTimeCategories,
min: 0,
max: this.bikeByTimeCategories.length -1
max: this.bikeByTimeCategories.length - 1,
title: {
text: 'A bicajjal töltött percek'
}
},
tooltip: {
headerFormat: '<span style="font-size:10px">{point.key} perc</span><table>',
pointFormat: '<tr><td style="padding:0"><b>{point.y:.0f} bicaj</b></td></tr>',
footerFormat: '</table>',
useHTML: true
},
credits: {
enabled: false
Expand Down
13 changes: 12 additions & 1 deletion src/Stations.vue
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,20 @@ export default Vue.extend({
}],
yAxis: {
title: {
text: null
text: 'Állomás'
}
},
xAxis: {
title: {
text: 'Látogatások száma'
}
},
tooltip: {
headerFormat: '<span style="font-size:10px">{point.key} látogatás</span><table>',
pointFormat: '<tr><td style="padding:0"><b>{point.y:.0f} állomás</b></td></tr>',
footerFormat: '</table>',
useHTML: true
},
credits: {
enabled: false
},
Expand Down
9 changes: 6 additions & 3 deletions src/TimePage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ export default Vue.extend({
},
series: [{
type: 'pie',
name: 'Utak',
name: 'Út',
data: this.statsByWeekdays
}],
credits: {
Expand Down Expand Up @@ -238,13 +238,16 @@ export default Vue.extend({
}],
yAxis: {
title: {
text: 'Utak'
text: 'Utak száma'
}
},
xAxis: {
categories: new Array<number>(24).fill(0).map((val, idx) => idx),
min: 0,
max: 23
max: 23,
title: {
text: 'Óra'
}
},
tooltip: {
headerFormat: '<span style="font-size:10px">{point.key}:00</span><table>',
Expand Down

0 comments on commit 28f5d24

Please sign in to comment.