Skip to content

Commit

Permalink
Merge branch 'master' into dashboard-filter
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickrobrecht authored Mar 8, 2018
2 parents 2c1a0eb + 55f1528 commit 1f06067
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ All notable changes to this project will be documented in this file. This projec

## unreleased
* Introduced new option to separate display from storage range
* Scaled datapoint size to number of records in dashboard widget to improve legibility

## 1.6.0
* Added hook statify__visit_saved which is fired after a visit was stored in the database.
Expand Down
7 changes: 6 additions & 1 deletion js/dashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,18 @@
]
});

var pointRadius = 4;
if (data.length > 365) pointRadius = 0;
else if (data.length > 180) pointRadius = 1;
else if (data.length > 90) pointRadius = 2;

// Replace default points with hollow circles, add "pageview(s) to value and append date (label) as meta data.
chart.on('draw', function (data) {
if ('point' === data.type) {
var circle = new Chartist.Svg('circle', {
cx: [data.x],
cy: [data.y],
r: [4],
r: [pointRadius],
'ct:value': data.value.y + ' ' + (data.value.y > 1 ? statify_translations.pageviews : statify_translations.pageview),
'ct:meta': labels[data.index]
}, 'ct-point');
Expand Down

0 comments on commit 1f06067

Please sign in to comment.