javascriptamchartsamcharts5

Change Cursoroverstyle for Bullets in Amcharts5 after clicking on button


I have created a MapPointSeries with bullets via

var pointSeries = chart.series.push(am5map.MapPointSeries.new(root, {
        latitudeField: "latitude",
        longitudeField: "longitude",
      }));
      pointSeries.bullets.push(function () {
        return am5.Bullet.new(root, {
          sprite: am5.Circle.new(root, {
            radius: 3,
            templateField: "bulletSettings"
          },bulletTemplate,
        });


var bulletTemplateClickable = am5.Template.new({
      fill: am5.color(0x000000),
      cursorOverStyle: "pointer"
    });

This works fine. However, now I want to change this cursorOverStyle to default, when a button is clicked and I just cannot seem to make it work. I tried to connect a different template or change the cursorOverStyle directly for the bullets themselves, but I cannot implement any of the solutions.


Solution

  • okay, deleting all bullets everytime and creating them new worked, even if that is oviously quite ugly