I have a problem with displaying the X-axis at the bottom of a Scatter-type graph when my Y values are negative. The X-Axis keeps showing at the top edge of the canvas (while the X labels are correctly positioned).
JS code used below, the div around the canvas has a black background which is why the axis and labels are white. Can anybody tell me what I am missing please ? (I'm new to RGraph, this is my first trial).
Thx Serge
// random 100 data points, x in 100..200, y in -120..-50
var data = [];
for(let i = 0; i < 100; i++) data.push([100+i, -50 - Math.random() * 70]);
var xmin = data[0][0], xmax = data[data.length - 1][0], ymin = data[0][1], ymax = data[0][1];
for(let i = 1; i < data.length; i++) { if(data[i][1] < ymin) ymin = data[i][1]; if(data[i][1] > ymax) ymax = data[i][1]; }
// scatter graph with white text, green lines, no ticks
var chart = new RGraph.Scatter({
id: 'chart',
data: data,
options: { backgroundGridDotted: true, marginLeft: 60, marginBottom: 50, line: true, tickmarksStyle: null, textColor: 'white',
xaxisScale: true, xaxisScaleMin: xmin, xaxisScaleMax:xmax, xaxisColor: 'white', xaxisTitle: 'Frequency (MHz)',
yaxisScaleMin: ymin, yaxisScaleMax: ymax, yaxisColor: 'white', yaxisTitle: 'Received Power Level (dBm)'
}
}).draw();