fixing minor bugs

master
Martin Zwigl 2025-03-20 00:06:38 +01:00
parent a34ef0c536
commit 23390d70a8
3 changed files with 6 additions and 5 deletions

View File

@ -45,7 +45,7 @@ function renderGraph(l) {
x: l.x, y: l.y, width: l.w, height: l.h,
miny: bounds.min,
maxy: bounds.max,
gridy: gridYValue
// gridy: gridYValue
});
}
@ -99,7 +99,8 @@ function getChart(period) {
// logFile.write("Chart data:" + JSON.stringify(tknChrtData));
currLoadMsg = "";
const oSpcOjb = ciLib.calculateOptimalYAxisSpacing(tknChrtData);
gridYValue = oSpcOjb.roundedInterval;
logFile.write("Y-Axis:" + JSON.stringify(oSpcOjb));
// gridYValue = oSpcOjb.roundedInterval;
//
g.clearRect(layout.tknGraph.x, layout.tknGraph.y, layout.tknGraph.w, layout.tknGraph.h);
layout.forgetLazyState(); // Force a full re-render

View File

@ -69,7 +69,7 @@ exports.calculateOptimalYAxisSpacing = function(data) {
}
// Find the minimum and maximum values in the data
const bounds = this.findMinMax(data);
const bounds = exports.findMinMax(data);
let minY = bounds.min;
let maxY = bounds.max;
@ -88,7 +88,7 @@ exports.calculateOptimalYAxisSpacing = function(data) {
let interval = range / (numTicks - 1);
// Round the interval to a nice number (e.g., 1, 2, 5, 10)
let roundedInterval = Math.pow(10, Math.floor(this.myLog10(interval)));
let roundedInterval = Math.pow(10, Math.floor(exports.myLog10(interval)));
if (interval / roundedInterval > 5) {
roundedInterval *= 5;
} else if (interval / roundedInterval > 2) {

View File

@ -1,7 +1,7 @@
{ "id": "coin_info",
"name": "Crypto-Coins Info",
"shortName":"Coins Info",
"version": "0.06.55",
"version": "0.06.56",
"description": "Crypto-Coins Infos with the help of the Binance API",
"icon": "app.png",
"tags": "clkinfo",