Fix: show failed record in result, ranking
This commit is contained in:
@@ -22,8 +22,11 @@ Chart.prototype.drawRecordGraph = function(index, date, bestRecord, min, max) {
|
||||
return;
|
||||
|
||||
var recordTextPosY = posY - Chart.CHART_HEIGHT - Chart.CHART_RECORD_OFFSET_Y;
|
||||
var absRecordValue = Math.abs(bestRecord);
|
||||
// var absRecordValue = Math.abs(bestRecord);
|
||||
var absRecordValue = bestRecord < 0 ? -1 * bestRecord : bestRecord;
|
||||
// var absRecordValue = Math.abs(Math.floor(bestRecord));
|
||||
var recordWithUnit = RecordUtil.getRecordValueWithUnit(absRecordValue, sessionStorageManager.getPlayingAppID());
|
||||
|
||||
if(bestRecord >= 0) {
|
||||
this.drawText(posX, recordTextPosY, recordWithUnit);
|
||||
} else {
|
||||
@@ -38,9 +41,14 @@ Chart.prototype.drawRecordGraph = function(index, date, bestRecord, min, max) {
|
||||
chartColor = 0xdddddd;
|
||||
else
|
||||
chartColor = 0xffaaaa;
|
||||
if(max < absRecordValue)
|
||||
max = absRecordValue * 1.1;
|
||||
this.chartGraphics.lineStyle(50, chartColor, 1);
|
||||
this.chartGraphics.moveTo(posX, posY);
|
||||
this.chartGraphics.lineTo(posX, posY - Chart.CHART_HEIGHT * ( (absRecordValue - min) / (max - min) ));
|
||||
console.log("absRecordValue : " + absRecordValue);
|
||||
console.log("min : " + min);
|
||||
console.log("max : " + max);
|
||||
}
|
||||
|
||||
Chart.prototype.drawText = function(posX, posY, text) {
|
||||
|
||||
Reference in New Issue
Block a user