title: How to dynamically add stockEvents to amCharts
body: <p>I have a function I'm using to add new data points to my stock chart. I need to create a condition under which one of the data points comes with an icon. I see that <code>stockEvents</code> can do this but it's not showing in my chart:</p>
  
  <pre><code>function addDataPoint(ask) {
          var dataProvider = chart.dataSets[0].dataProvider;
          var newDate = new Date(dataProvider[dataProvider.length - 1].date.getTime());
          newDate.setHours(newDate.getHours(), newDate.getMinutes() + 1, newDate.getSeconds());
          var a = Math.round(Math.random() * (40 + 1000)) + 100 + 1000;
          var b = Math.round(Math.random() * 100000000);
          dataProvider.push({
              date: newDate,
              value: ask,
              volume: ask
          });
          chart.dataSets[0].stockEvents = [{
              date: newDate,
              type: "flag",
              text: "F",
              description: "Some longer\ntext can also\n be added"
          }];
          dataProvider.shift();
      }
  </code></pre>