diff --git a/anki/stats.py b/anki/stats.py index 01c814a35..2e12b2fd1 100644 --- a/anki/stats.py +++ b/anki/stats.py @@ -863,8 +863,12 @@ $(function () { } } conf.yaxis.minTickSize = 1; + // prevent ticks from having decimals (use whole numbers instead) + conf.yaxis.tickDecimals = 0; conf.yaxis.tickFormatter = function (val, axis) { - return val.toFixed(0); + // Just in case we get ticks with decimals, render to one decimal position. If it's + // a whole number then render without any decimal (i.e. without the trailing .0). + return val === Math.round(val) ? val.toFixed(0) : val.toFixed(1); } if (conf.series.pie) { conf.series.pie.label.formatter = function(label, series){ diff --git a/aqt/browser.py b/aqt/browser.py index 618db5159..c659078fd 100644 --- a/aqt/browser.py +++ b/aqt/browser.py @@ -189,7 +189,11 @@ class DataModel(QAbstractTableModel): tv = self.browser.form.tableView if idx: tv.selectRow(idx.row()) + # we save and then restore the horizontal scroll position because + # scrollTo() also scrolls horizontally which is confusing + h = tv.horizontalScrollBar().value() tv.scrollTo(idx, tv.PositionAtCenter) + tv.horizontalScrollBar().setValue(h) if count < 500: # discard large selections; they're too slow sm.select(items, QItemSelectionModel.SelectCurrent |