title: Amcharts am4core function not defined
body: <p>I have created an interactive 2 series XY area chart for spreader beams using Amcharts, having  enqued the amchart cdn files in to Wordpress, but the chart only show in the page builder, Elementor, not on site. There is an error, am4core function not defined, and a cross origin error from amcharts, though all the sources show in chrome dev tools. Code is below, colors changed from an orginal fiddle by</p>
  <p><a href="https://stackoverflow.com/users/10419523/mohamed-ali-o-ameur">https://stackoverflow.com/users/10419523/mohamed-ali-o-ameur</a></p>
  <p>Url is at <a href="https://applifting.ga/modular-spreader-beams/sectionlift-6/" rel="nofollow noreferrer">https://applifting.ga/modular-spreader-beams/sectionlift-6/</a></p>
  <p>Any idea why this showing in Elementor but not on live site?</p>
  <p><a href="https://i.stack.imgur.com/1wy6K.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1wy6K.png" alt="Amcharts Elementor view" /></a></p>
  
  <pre><code>let chart = am4core.createFromConfig({
      &quot;data&quot;: [{
          &quot;category&quot;: 0.5,
          &quot;value1&quot;: 8,
          &quot;value2&quot;: 6.7
      }, {
          &quot;category&quot;: 1,
          &quot;value1&quot;: 8,
          &quot;value2&quot;: 6.7
      }, {
          &quot;category&quot;: 1.5,
          &quot;value1&quot;: 8,
          &quot;value2&quot;: 6.7
      }, {
          &quot;category&quot;: 2,
          &quot;value1&quot;: 8,
          &quot;value2&quot;: 6.7
      }, {
          &quot;category&quot;: 2.5,
          &quot;value1&quot;: 8,
          &quot;value2&quot;: 5
      }, {
          &quot;category&quot;: 3,
          &quot;value1&quot;: 6.5,
          &quot;value2&quot;: 3.7
      }, {
          &quot;category&quot;: 3.5,
          &quot;value1&quot;: 5,
          &quot;value2&quot;: 2.9
      }, {
          &quot;category&quot;: 4,
          &quot;value1&quot;: 3.9,
          &quot;value2&quot;: 2.3
      }],
      &quot;xAxes&quot;: [{
          &quot;type&quot;: &quot;CategoryAxis&quot;,
          &quot;id&quot;: &quot;id-1&quot;,
          &quot;title&quot;: {
              &quot;type&quot;: &quot;Label&quot;,
              &quot;id&quot;: &quot;span&quot;,
              &quot;text&quot;: &quot;Span in Metres&quot;
          },
          &quot;dataFields&quot;: {
              &quot;category&quot;: &quot;category&quot;
          },
          &quot;startLocation&quot;: 0.5,
          &quot;endLocation&quot;: 0.5,
          &quot;renderer&quot;: {
              &quot;grid&quot;: {
                  &quot;template&quot;: {
                      &quot;type&quot;: &quot;Grid&quot;,
                      &quot;location&quot;: 0.5
                  }
              },
              &quot;minGridDistance&quot;: 20
          }
      }],
      &quot;yAxes&quot;: [{
          &quot;type&quot;: &quot;ValueAxis&quot;,
          &quot;id&quot;: &quot;id-2&quot;,
          &quot;title&quot;: {
              &quot;type&quot;: &quot;Label&quot;,
              &quot;id&quot;: &quot;swl&quot;,
              &quot;text&quot;: &quot;S.W.L in Tonnes&quot;,
              &quot;propertyFields&quot;: {}
          },
          &quot;min&quot;: &quot;0&quot;,
          &quot;max&quot;: &quot;10&quot;,
          &quot;renderer&quot;: {
              &quot;maxLabelPosition&quot;: 0.98
          }
      }],
      &quot;series&quot;: [{
          &quot;type&quot;: &quot;LineSeries&quot;,
          &quot;name&quot;: &quot;30° Sling To Vertical Angle&quot;,
          &quot;xAxis&quot;: &quot;id-1&quot;,
          &quot;yAxis&quot;: &quot;id-2&quot;,
          &quot;baseAxis&quot;: &quot;id-1&quot;,
          &quot;dataFields&quot;: {
              &quot;valueY&quot;: &quot;value1&quot;,
              &quot;categoryX&quot;: &quot;category&quot;
          },
          &quot;fillOpacity&quot;: 0.5,
          &quot;strokeWidth&quot;: 2,
          &quot;sequencedInterpolation&quot;: true,
          &quot;sequencedInterpolationDelay&quot;: 100,
          &quot;tooltipText&quot;: &quot;{name}\n{categoryX}: {valueY}&quot;
      }, {
          &quot;type&quot;: &quot;LineSeries&quot;,
          &quot;name&quot;: &quot;45° Sling To Vertical Angle&quot;,
          &quot;xAxis&quot;: &quot;id-1&quot;,
          &quot;yAxis&quot;: &quot;id-2&quot;,
          &quot;dataFields&quot;: {
              &quot;valueY&quot;: &quot;value2&quot;,
              &quot;categoryX&quot;: &quot;category&quot;
          },
          &quot;simplifiedProcessing&quot;: true,
          &quot;calculatePercent&quot;: true,
          &quot;fillOpacity&quot;: 0.5,
          &quot;strokeWidth&quot;: 2,
          &quot;sequencedInterpolation&quot;: true,
          &quot;sequencedInterpolationDelay&quot;: 100,
          &quot;tooltipText&quot;: &quot;{name}\n{categoryX}: {valueY}&quot;
      }],
      &quot;legend&quot;: {
          &quot;type&quot;: &quot;Legend&quot;,
          &quot;setStateOnChildren&quot;: true,
          &quot;showOnInit&quot;: true,
          &quot;visible&quot;: true,
          &quot;disabled&quot;: false,
          &quot;dataFields&quot;: {},
          &quot;position&quot;: &quot;top&quot;
      },
      &quot;cursor&quot;: {
          &quot;type&quot;: &quot;XYCursor&quot;,
          &quot;tooltipPosition&quot;: &quot;fixed&quot;
      },
      &quot;dataFields&quot;: {},
      &quot;colors&quot;: {
          &quot;type&quot;: &quot;ColorSet&quot;,
          &quot;wrap&quot;: false,
          &quot;shuffle&quot;: false,
          &quot;reuse&quot;: false,
          &quot;baseColor&quot;: &quot;#567876&quot;
      }
  
  
  }, &quot;$CHART$&quot;, am4charts.XYChart);
  </code></pre>
  <p>Thanks</p>