When utilizing AmCharts for stock-related events, I encountered an unusual error in my console window:
Uncaught TypeError: Cannot read property 'mouseX' of undefined
at b.followCursor (amcharts.js:271)
at b.showBalloonReal (amcharts.js:130)
at amcharts.js:130
Here is a snippet of my code where I fill data into the dividendEventData variable:
function getCompanyEventChartData() {
var jqhx = $.ajax({
type: "GET",
data: { 'marketID': '@Model.MarketID', 'companyID': '@Model.CompanyID' },
url: "@Url.CompanyChartEvent()"
})
.done(function (data) {
// Iterate over the data and process accordingly
});
The format of dividendEventData array looks like this:
[["Sunday, 18, Dec, 2016",31],["Thursday, 24, Dec, 2015",31], ...]
I then add dividendEventData to my chart using the following code:
simpleDataSet.stockEvents = dividendEventData;
setTimeout(function () {
$("#chartcurtain").hide();
chart.validateData();
}, 1000);
Although initially working fine, my chart fails to display descriptions upon subsequent reloads. When hovering over event icons, the description does not appear and the aforementioned error pops up in the console. I have tried clearing cookies and verifying consistent data from the AJAX call, yet the issue persists.