Closed BrunoJ75 closed 1 year ago
It's a bug on our side - thanks for the heads up. We do dispose tooltip when disposing sprite if it is assigned to this sprite, to avoid memory leaks. We will discuss how to solve this issue. Meanwhile you can simply create a new instance of a tooltip before creating new events:
function setDataInterval(interval) {
tooltip = am5.Tooltip.new(root, {
getStrokeFromSprite: false,
getFillFromSprite: false
});
makeEvent(1619006400000, "S", am5.color(0xff0000), "Split 4:1")
makeEvent(1619006400000, "D", am5.color(0x00FF00), "Dividends paid")
makeEvent(1634212800000, "D", am5.color(0x00FF00), "Dividends paid")
// then load new data
}
Thanks for the reply
I tried creating a new instance of tooltip before creating new events but it does'nt work for me When I add your code, I still have the "EventDispacther is disposed" error
I don't get the error: https://codepen.io/team/amcharts/pen/MWzJeXR/ce633059643b958efbbcd02ca8a66864
I also noticed that the new bullets are not properly stacked, I'll investigate why.
Sorry, bad copy/paste on my side, the trick works ;)
I think you also have a problem with valueAxis on stockcharts With penny stocks, the axis shows highly negative values A stock price never has a negative value, the axis shouldn't go under 0
If you try with the dataset below (monthly values) and zoom to something less than 1Y, you can't see anything anymore It's even worth using weekly or daily values
var data = [
{ Date: 1271800800000, Open: 318182000, High: 358143000, Low: 316674000, Close: 321952000, Volume: 0 },
{ Date: 1272837600000, Open: 318182000, High: 324968000, Low: 227704000, Close: 236752000, Volume: 0 },
{ Date: 1275343200000, Open: 241275000, High: 254847000, Low: 211116000, Close: 251077000, Volume: 0 },
{ Date: 1277935200000, Open: 245045000, High: 250323000, Low: 218656000, Close: 224688000, Volume: 0 },
{ Date: 1280700000000, Open: 229966000, High: 235244000, Low: 214132000, Close: 223180000, Volume: 0 },
{ Date: 1283292000000, Open: 223180000, High: 240521000, Low: 214132000, Close: 226196000, Volume: 0 },
{ Date: 1285884000000, Open: 231474000, High: 231474000, Low: 207346000, Close: 211116000, Volume: 0 },
{ Date: 1288566000000, Open: 211116000, High: 215640000, Low: 191512000, Close: 197544000, Volume: 0 },
{ Date: 1291158000000, Open: 196036000, High: 202068000, Low: 169647000, Close: 179449000, Volume: 0 },
{ Date: 1294009200000, Open: 180957000, High: 214886000, Low: 180957000, Close: 211116000, Volume: 0 },
{ Date: 1296514800000, Open: 211116000, High: 260879000, Low: 205838000, Close: 260125000, Volume: 0 },
{ Date: 1298934000000, Open: 254847000, High: 336278000, Low: 236752000, Close: 297824000, Volume: 0 },
{ Date: 1301608800000, Open: 297070000, High: 325722000, Low: 283499000, Close: 298578000, Volume: 0 },
{ Date: 1304287200000, Open: 300086000, High: 350603000, Low: 288023000, Close: 333262000, Volume: 0 },
{ Date: 1306879200000, Open: 324214000, High: 399612000, Low: 294054000, Close: 309134000, Volume: 0 },
{ Date: 1309471200000, Open: 298578000, High: 345325000, Low: 260125000, Close: 314412000, Volume: 0 },
{ Date: 1312149600000, Open: 321952000, High: 326476000, Low: 265403000, Close: 297070000, Volume: 0 },
{ Date: 1314828000000, Open: 298578000, High: 298578000, Low: 226196000, Close: 254847000, Volume: 0 },
{ Date: 1317592800000, Open: 257863000, High: 277467000, Low: 241275000, Close: 277467000, Volume: 0 },
{ Date: 1320102000000, Open: 276713000, High: 293300000, Low: 226196000, Close: 253339000, Volume: 0 },
{ Date: 1322694000000, Open: 257863000, High: 290285000, Low: 236752000, Close: 263141000, Volume: 0 },
{ Date: 1325458800000, Open: 267665000, High: 331754000, Low: 265403000, Close: 286515000, Volume: 0 },
{ Date: 1328050800000, Open: 285761000, High: 358143000, Low: 281991000, Close: 357389000, Volume: 0 },
{ Date: 1330556400000, Open: 360405000, High: 360405000, Low: 311396000, Close: 314412000, Volume: 0 },
{ Date: 1333317600000, Open: 318936000, High: 333262000, Low: 253339000, Close: 289531000, Volume: 0 },
{ Date: 1335909600000, Open: 288023000, High: 288777000, Low: 236752000, Close: 255601000, Volume: 0 },
{ Date: 1338501600000, Open: 254093000, High: 254093000, Low: 94248200, Close: 121392000, Volume: 0 },
{ Date: 1341180000000, Open: 121392000, High: 140241000, Low: 104804000, Close: 109328000, Volume: 0 },
{ Date: 1343772000000, Open: 109328000, High: 140995000, Low: 106312000, Close: 128932000, Volume: 0 },
{ Date: 1346623200000, Open: 134209000, High: 147027000, Low: 126670000, Close: 126670000, Volume: 0 },
{ Date: 1349042400000, Open: 125916000, High: 243537000, Low: 121392000, Close: 183973000, Volume: 0 },
{ Date: 1351724400000, Open: 183973000, High: 239767000, Low: 172663000, Close: 183219000, Volume: 0 },
{ Date: 1354489200000, Open: 177941000, High: 193020000, Low: 172663000, Close: 172663000, Volume: 0 },
{ Date: 1357081200000, Open: 193774000, High: 207346000, Low: 179449000, Close: 188496000, Volume: 0 },
{ Date: 1359673200000, Open: 187742000, High: 248815000, Low: 158337000, Close: 165377000, Volume: 0 },
{ Date: 1362092400000, Open: 165377000, High: 173141000, Low: 142861000, Close: 143637000, Volume: 0 },
{ Date: 1364853600000, Open: 146743000, High: 157613000, Low: 116463000, Close: 154507000, Volume: 0 },
{ Date: 1367445600000, Open: 155283000, High: 156060000, Low: 138979000, Close: 145190000, Volume: 0 },
{ Date: 1370210400000, Open: 147519000, High: 152178000, Low: 124227000, Close: 138979000, Volume: 0 },
{ Date: 1372629600000, Open: 141308000, High: 151401000, Low: 135873000, Close: 141308000, Volume: 0 },
{ Date: 1375308000000, Open: 140532000, High: 161495000, Low: 134320000, Close: 144414000, Volume: 0 },
{ Date: 1378072800000, Open: 144414000, High: 150625000, Low: 128885000, Close: 135097000, Volume: 0 },
{ Date: 1380578400000, Open: 135097000, High: 158389000, Low: 130438000, Close: 142084000, Volume: 0 },
{ Date: 1383260400000, Open: 142861000, High: 146743000, Low: 123450000, Close: 133544000, Volume: 0 },
{ Date: 1385938800000, Open: 132767000, High: 196434000, Low: 128885000, Close: 168483000, Volume: 0 },
{ Date: 1388617200000, Open: 170035000, High: 229819000, Low: 163048000, Close: 194104000, Volume: 0 },
{ Date: 1391382000000, Open: 197986000, High: 341624000, Low: 174694000, Close: 295038000, Volume: 0 },
{ Date: 1393801200000, Open: 287274000, High: 340071000, Low: 242242000, Close: 253888000, Volume: 0 },
{ Date: 1396303200000, Open: 257770000, High: 269417000, Low: 196434000, Close: 227490000, Volume: 0 },
{ Date: 1398895200000, Open: 227490000, High: 258547000, Low: 210409000, Close: 246901000, Volume: 0 },
{ Date: 1401660000000, Open: 252336000, High: 307461000, Low: 218950000, Close: 284169000, Volume: 0 },
{ Date: 1404165600000, Open: 287274000, High: 295038000, Low: 248453000, Close: 256218000, Volume: 0 },
{ Date: 1406844000000, Open: 256218000, High: 284169000, Low: 232925000, Close: 273299000, Volume: 0 },
{ Date: 1409522400000, Open: 271746000, High: 313673000, Low: 262429000, Close: 291156000, Volume: 0 },
{ Date: 1412114400000, Open: 297368000, High: 301250000, Low: 213515000, Close: 234478000, Volume: 0 },
{ Date: 1414969200000, Open: 233702000, High: 300473000, Low: 232925000, Close: 263982000, Volume: 0 },
{ Date: 1417388400000, Open: 262429000, High: 296591000, Low: 76865300, Close: 93170100, Volume: 0 },
{ Date: 1420153200000, Open: 97052100, High: 97828600, Low: 80747400, Close: 93170100, Volume: 0 },
{ Date: 1422831600000, Open: 92393600, High: 94722900, Low: 83076600, Close: 86182300, Volume: 0 },
{ Date: 1425250800000, Open: 86182300, High: 96275700, Low: 72206800, Close: 76865300, Volume: 0 },
{ Date: 1427839200000, Open: 81523800, High: 90064400, Low: 77641700, Close: 80747400, Volume: 0 },
{ Date: 1430690400000, Open: 82300200, High: 92393600, Low: 77641700, Close: 83853000, Volume: 0 },
{ Date: 1433109600000, Open: 83853000, High: 114133000, Low: 83853000, Close: 86958700, Volume: 0 },
{ Date: 1435701600000, Open: 86958700, High: 93170100, Low: 78418100, Close: 79194500, Volume: 0 },
{ Date: 1438552800000, Open: 79971000, High: 84629500, Low: 66771900, Close: 75312500, Volume: 0 },
{ Date: 1441058400000, Open: 85405900, High: 86958700, Low: 51243500, Close: 55902000, Volume: 0 },
{ Date: 1443650400000, Open: 57454900, High: 64442600, Low: 52019900, Close: 57454900, Volume: 0 },
{ Date: 1446418800000, Open: 56678400, High: 64442600, Low: 52019900, Close: 60560500, Volume: 0 },
{ Date: 1448924400000, Open: 65219000, High: 93946500, Low: 54349200, Close: 89288000, Volume: 0 },
{ Date: 1451862000000, Open: 85405900, High: 125003000, Low: 79971000, Close: 111028000, Volume: 0 },
{ Date: 1454281200000, Open: 114133000, High: 114133000, Low: 77641700, Close: 86958700, Volume: 0 },
{ Date: 1456786800000, Open: 88511500, High: 97828600, Low: 82300200, Close: 93170100, Volume: 0 },
{ Date: 1459461600000, Open: 93170100, High: 106369000, Low: 89288000, Close: 96275700, Volume: 0 },
{ Date: 1462140000000, Open: 97052100, High: 97828600, Low: 85405900, Close: 88511500, Volume: 0 },
{ Date: 1464732000000, Open: 79971000, High: 81523800, Low: 52800000, Close: 59200000, Volume: 0 },
{ Date: 1467324000000, Open: 59200000, High: 67200000, Low: 54400000, Close: 64800000, Volume: 0 },
{ Date: 1470002400000, Open: 65600000, High: 66400000, Low: 60000000, Close: 62400000, Volume: 0 },
{ Date: 1472680800000, Open: 62400000, High: 68800000, Low: 58400000, Close: 59200000, Volume: 0 },
{ Date: 1475445600000, Open: 58400000, High: 60800000, Low: 53600000, Close: 55200000, Volume: 0 },
{ Date: 1477954800000, Open: 53600000, High: 61600000, Low: 53600000, Close: 56800000, Volume: 0 },
{ Date: 1480546800000, Open: 56800000, High: 66400000, Low: 56000000, Close: 64800000, Volume: 0 },
{ Date: 1483311600000, Open: 64800000, High: 83200000, Low: 63200000, Close: 66400000, Volume: 0 },
{ Date: 1485903600000, Open: 67200000, High: 89600000, Low: 64800000, Close: 72800000, Volume: 0 },
{ Date: 1488322800000, Open: 72800000, High: 76800000, Low: 68000000, Close: 72000000, Volume: 0 },
{ Date: 1491170400000, Open: 72800000, High: 72800000, Low: 61600000, Close: 66400000, Volume: 0 },
{ Date: 1493676000000, Open: 65600000, High: 73600000, Low: 63200000, Close: 70400000, Volume: 0 },
{ Date: 1496268000000, Open: 70400000, High: 70400000, Low: 64000000, Close: 66400000, Volume: 0 },
{ Date: 1499032800000, Open: 65600000, High: 68800000, Low: 57600000, Close: 60000000, Volume: 0 },
{ Date: 1501538400000, Open: 58400000, High: 63200000, Low: 54400000, Close: 56000000, Volume: 0 },
{ Date: 1504216800000, Open: 56000000, High: 57600000, Low: 47200000, Close: 48800000, Volume: 0 },
{ Date: 1506895200000, Open: 48000000, High: 49600000, Low: 40000000, Close: 43200000, Volume: 0 },
{ Date: 1509490800000, Open: 42400000, High: 45600000, Low: 40800000, Close: 44000000, Volume: 0 },
{ Date: 1512082800000, Open: 44000000, High: 52800000, Low: 35200000, Close: 36800000, Volume: 0 },
{ Date: 1514847600000, Open: 36800000, High: 47040000, Low: 36080000, Close: 43200000, Volume: 0 },
{ Date: 1517439600000, Open: 43760000, High: 44160000, Low: 36880000, Close: 40480000, Volume: 0 },
{ Date: 1519858800000, Open: 39000000, High: 39840000, Low: 35280000, Close: 36000000, Volume: 0 },
{ Date: 1522706400000, Open: 36000000, High: 36000000, Low: 28160000, Close: 29680000, Volume: 0 },
{ Date: 1525212000000, Open: 29800000, High: 31760000, Low: 26160000, Close: 27600000, Volume: 0 },
{ Date: 1527804000000, Open: 27760000, High: 32400000, Low: 24800000, Close: 29560000, Volume: 0 },
{ Date: 1530482400000, Open: 29560000, High: 34360000, Low: 21680000, Close: 25960000, Volume: 0 },
{ Date: 1533074400000, Open: 26000000, High: 27600000, Low: 24080000, Close: 26480000, Volume: 0 },
{ Date: 1535925600000, Open: 26880000, High: 30000000, Low: 22920000, Close: 23360000, Volume: 0 },
{ Date: 1538344800000, Open: 23200000, High: 23200000, Low: 15616000, Close: 18400000, Volume: 0 },
{ Date: 1541026800000, Open: 18720000, High: 20400000, Low: 15888000, Close: 17360000, Volume: 0 },
{ Date: 1543791600000, Open: 17320000, High: 18040000, Low: 14096000, Close: 16240000, Volume: 0 },
{ Date: 1546383600000, Open: 16240000, High: 17720000, Low: 14800000, Close: 15472000, Volume: 0 },
{ Date: 1548975600000, Open: 16880000, High: 30560000, Low: 15600000, Close: 20520000, Volume: 0 },
{ Date: 1551394800000, Open: 20320000, High: 21560000, Low: 16560000, Close: 17200000, Volume: 0 },
{ Date: 1554069600000, Open: 17800000, High: 19960000, Low: 14768000, Close: 15536000, Volume: 0 },
{ Date: 1556748000000, Open: 15600000, High: 17440000, Low: 11296000, Close: 11632000, Volume: 0 },
{ Date: 1559512800000, Open: 11360000, High: 11968000, Low: 9376000, Close: 10672000, Volume: 0 },
{ Date: 1561932000000, Open: 10720000, High: 11120000, Low: 8640000, Close: 9456000, Volume: 0 },
{ Date: 1564610400000, Open: 9136000, High: 9424000, Low: 7568000, Close: 7992000, Volume: 0 },
{ Date: 1567375200000, Open: 7992000, High: 8144000, Low: 6944000, Close: 7296000, Volume: 0 },
{ Date: 1569880800000, Open: 7040000, High: 7192000, Low: 3920000, Close: 4112000, Volume: 0 },
{ Date: 1572562800000, Open: 4120000, High: 5280000, Low: 4120000, Close: 4640000, Volume: 0 },
{ Date: 1575241200000, Open: 4640000, High: 4640000, Low: 4640000, Close: 4640000, Volume: 0 },
{ Date: 1577919600000, Open: 4640000, High: 4640000, Low: 4640000, Close: 4640000, Volume: 0 },
{ Date: 1580684400000, Open: 4640000, High: 4640000, Low: 4640000, Close: 4640000, Volume: 0 },
{ Date: 1583103600000, Open: 4640000, High: 4640000, Low: 4640000, Close: 4640000, Volume: 0 },
{ Date: 1585692000000, Open: 4640000, High: 4640000, Low: 4640000, Close: 4640000, Volume: 0 },
{ Date: 1588543200000, Open: 4640000, High: 20240000, Low: 4640000, Close: 7672000, Volume: 2 },
{ Date: 1590962400000, Open: 7680000, High: 19800000, Low: 7040000, Close: 17200000, Volume: 2 },
{ Date: 1593554400000, Open: 19600000, High: 23640000, Low: 8080000, Close: 8288000, Volume: 2 },
{ Date: 1596405600000, Open: 8528000, High: 9424000, Low: 7488000, Close: 7520000, Volume: 0 },
{ Date: 1598911200000, Open: 7600000, High: 7696000, Low: 4168000, Close: 4512000, Volume: 0 },
{ Date: 1601503200000, Open: 4616000, High: 6304000, Low: 3440000, Close: 3544000, Volume: 1 },
{ Date: 1604271600000, Open: 3696000, High: 4640000, Low: 2256000, Close: 2680000, Volume: 6 },
{ Date: 1606777200000, Open: 2784000, High: 3744000, Low: 2400000, Close: 2416000, Volume: 9 },
{ Date: 1609714800000, Open: 2472000, High: 2592000, Low: 1896000, Close: 1928000, Volume: 4 },
{ Date: 1612134000000, Open: 1944000, High: 2760000, Low: 1784000, Close: 1960000, Volume: 11 },
{ Date: 1614553200000, Open: 1984000, High: 2208000, Low: 1216000, Close: 1248000, Volume: 6 },
{ Date: 1617228000000, Open: 1232000, High: 1296000, Low: 992000, Close: 1032000, Volume: 0 },
{ Date: 1619992800000, Open: 1008000, High: 2872000, Low: 776000, Close: 816000, Volume: 62 },
{ Date: 1622498400000, Open: 816000, High: 1096000, Low: 480000, Close: 488000, Volume: 52 },
{ Date: 1625090400000, Open: 496000, High: 496000, Low: 264000, Close: 280000, Volume: 33 },
{ Date: 1627855200000, Open: 280000, High: 336000, Low: 240000, Close: 280000, Volume: 81 },
{ Date: 1630447200000, Open: 280000, High: 416000, Low: 192000, Close: 200000, Volume: 83 },
{ Date: 1633039200000, Open: 200000, High: 200000, Low: 64000, Close: 72000, Volume: 85 },
{ Date: 1635721200000, Open: 72000, High: 112000, Low: 56000, Close: 72000, Volume: 72 },
{ Date: 1638313200000, Open: 80000, High: 112000, Low: 40000, Close: 40000, Volume: 67 },
{ Date: 1641164400000, Open: 40000, High: 56000, Low: 16000, Close: 24000, Volume: 57 },
{ Date: 1643670000000, Open: 19680, High: 35192, Low: 10456, Close: 13720, Volume: 451 },
{ Date: 1646089200000, Open: 13600, High: 14480, Low: 7920, Close: 8222.4, Volume: 538 },
{ Date: 1648764000000, Open: 8240, High: 8552, Low: 3200.8, Close: 3264, Volume: 576 },
{ Date: 1651442400000, Open: 3200, High: 3351.2, Low: 1391.2, Close: 1444, Volume: 793 },
{ Date: 1654034400000, Open: 1403.2, High: 1600, Low: 960, Close: 992, Volume: 1428 },
{ Date: 1656626400000, Open: 1006.4, High: 1024, Low: 723.2, Close: 724.8, Volume: 687 },
{ Date: 1659304800000, Open: 743.2, High: 3104, Low: 681.6, Close: 694.4, Volume: 7884 },
{ Date: 1661983200000, Open: 720, High: 720, Low: 448.8, Close: 480, Volume: 1675 },
{ Date: 1664748000000, Open: 500, High: 544, Low: 161.6, Close: 173.6, Volume: 4510 },
{ Date: 1667257200000, Open: 182.4, High: 188.8, Low: 84, Close: 91.2, Volume: 9875 },
{ Date: 1669849200000, Open: 84.8, High: 92, Low: 27.2, Close: 33.6, Volume: 51586 },
{ Date: 1672614000000, Open: 35.2, High: 52, Low: 12, Close: 12, Volume: 80329 },
{ Date: 1675206000000, Open: 12.8, High: 14.4, Low: 6.4, Close: 7.2, Volume: 66183 },
{ Date: 1677625200000, Open: 8, High: 11.2, Low: 2.4, Close: 3.2, Volume: 216430 },
{ Date: 1680472800000, Open: 4, High: 4.8, Low: 1.6, Close: 2.4, Volume: 121000 },
{ Date: 1682978400000, Open: 3.2, High: 3.2, Low: 0.8, Close: 1.6, Volume: 371823 },
{ Date: 1685570400000, Open: 0.8, High: 1.6, Low: 0.5, Close: 0.71, Volume: 1134959 },
];
Please, create a separate ticket as this is not related. And it would be best if you could provide a working codepen.
Hi,
I tried using your stockchart graph demo I added an interval switcher and an event than listens when a new interval is selected When this event is fired, if I clear the list of dividend/split bullets and then add new bullets, the tooltips doesn't show anymore and the console says: EventDispatcher is disposed
The modified demo code bellow: