Thanks for reporting. We are looking into it and get back to you at the earliest.
—
Vishwas R
Thibault,
By setting axisX.reversed property to true, you can achieve this. Please check this updated jsfiddle.
—
Vishwas R
@aleckcstef, @mikkelbs, @mariomario,
[UPDATE]: We’ve fixed this issue in the latest build. Please, do download the latest version and let us know your feedback.
We tried reproducing the issue at our end. But it seems to be working fine across multiple devices which includes Moto, Samsung, Lenovo, One Plus, HTC, Dell. Can you kindly check the following links and let us know which all events are not working among your devices.
https://canvasjs.com/docs/charts/chart-options/data/mousemove/
https://canvasjs.com/docs/charts/chart-options/data/mouseover/
https://canvasjs.com/docs/charts/chart-options/data/mouseout/
https://canvasjs.com/docs/charts/chart-options/data/click/
And at the same time kindly share following information:
1. Tab model
2. Android version
3. Browser version
—
Vishwas R
You can fetch the latest row in database, parse it and add it to chart-dataPoints. Please refer the following links for more information on retrieving latest row from database.
http://stackoverflow.com/questions/22323682/how-to-get-the-latest-row-in-a-table-using-entity-framework-considering-perform
http://stackoverflow.com/questions/18528736/how-to-retrieve-values-from-the-last-row-in-a-datatable
http://dba.stackexchange.com/questions/69358/retrieve-recently-inserted-5-rows
—
Vishwas R
By changing few lines of code according to your json format, its possible to render multi-series chart based on the key (label) from JSON. Please check this jsfiddle.
—
Vishwas R
data.sort((a,b)=>a-b);
works on array but not on array of objects. You need to sort it manually to handle it. Please chek out the code-snippet to sort datapoints below.
for (var i = 0; i < dataPoints.length - 1; i++) {
if (dataPoints[i].x > dataPoints[i + 1].x) {
var temp = dataPoints[i];
dataPoints[i] = dataPoints[i + 1];
dataPoints[i + 1] = temp;
i = 0;
}
}
Please check this JSFiddle for complete code.
Also please refer to this documentation page for tutorial on dynamically updating chart from JSON data.
—
Vishwas R
The issue is in updateChart function. It fails to enter for-loop as value of x (var x = i;
) is same as the value of result.length. Read data from database, store it in another variable (lets say result1) and then push that to dataPoints as shown below.
var updateChart = function () {
for(var y=0; y < result1.length; y++){
dataPoints.push({label:result1[y].Date, y:result1[y].Value2});
}
x=y;
chart.render();
};
Please check this updated project
—
Vishwas R