OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

AmCharts Congressional map

  • Thread starter Thread starter Connor Brantley
  • Start date Start date
C

Connor Brantley

Guest
I am trying to use a congressional map amCharts provides. However, I am unable to get it to load and I have had success with other charts and maps so I'm not sure what the problem is. The congressional map simply does not appear as you can see here. The other maps load but the congressional one is not present.

I am using WeWeb as my front-end and have formatted the JavaScript using https://weweb-embed.statechange.ai/. Below are the resources amCharts provides and that I install on the app load. (All available on the congressional map documentation)

Code:
  if(!window["scp-loading-4c8c5502-9b3b-4503-9eb3-00bdacdd6689"]) {
    window["scp-loading-4c8c5502-9b3b-4503-9eb3-00bdacdd6689"] = true;
    let doc;
    /* Adding script from https://cdn.amcharts.com/lib/5/index.js */
    doc = document.createElement('script');
    doc.src = 'https://cdn.amcharts.com/lib/5/index.js';
    document.body.appendChild(doc);
    /* Adding script from https://cdn.amcharts.com/lib/5/map.js */
    doc = document.createElement('script');
    doc.src = 'https://cdn.amcharts.com/lib/5/map.js';
    document.body.appendChild(doc);
    /* Adding script from https://cdn.amcharts.com/lib/5/geodata/region/usa/congressional2022/usaCongressionalLow.js */
    doc = document.createElement('script');
    doc.src = 'https://cdn.amcharts.com/lib/5/geodata/region/usa/congressional2022/usaCongressionalLow.js';
    document.body.appendChild(doc);
    /* Adding script from https://cdn.amcharts.com/lib/5/themes/Animated.js */
    doc = document.createElement('script');
    doc.src = 'https://cdn.amcharts.com/lib/5/themes/Animated.js';
    document.body.appendChild(doc);
  }

I then have the map appear in a container "chartdiv" using the following:

(please see first comment since this is capped at 30,000 characters.)

<p>I am trying to use a congressional map amCharts <a href="https://www.amcharts.com/demos/us-congressional-districts/" rel="nofollow noreferrer">provides</a>. However, I am unable to get it to load and I have had success with other charts and maps so I'm not sure what the problem is. The congressional map simply does not appear as you can see <a href="https://i.sstatic.net/X4yAEOcg.png" rel="nofollow noreferrer">here</a>. The other maps load but the congressional one is not present.</p>
<p>I am using WeWeb as my front-end and have formatted the JavaScript using <a href="https://weweb-embed.statechange.ai/" rel="nofollow noreferrer">https://weweb-embed.statechange.ai/</a>. Below are the resources amCharts provides and that I install on the app load. (All available on the congressional map <a href="https://www.amcharts.com/demos/us-congressional-districts/" rel="nofollow noreferrer">documentation</a>)</p>
<pre><code> if(!window["scp-loading-4c8c5502-9b3b-4503-9eb3-00bdacdd6689"]) {
window["scp-loading-4c8c5502-9b3b-4503-9eb3-00bdacdd6689"] = true;
let doc;
/* Adding script from https://cdn.amcharts.com/lib/5/index.js */
doc = document.createElement('script');
doc.src = 'https://cdn.amcharts.com/lib/5/index.js';
document.body.appendChild(doc);
/* Adding script from https://cdn.amcharts.com/lib/5/map.js */
doc = document.createElement('script');
doc.src = 'https://cdn.amcharts.com/lib/5/map.js';
document.body.appendChild(doc);
/* Adding script from https://cdn.amcharts.com/lib/5/geodata/region/usa/congressional2022/usaCongressionalLow.js */
doc = document.createElement('script');
doc.src = 'https://cdn.amcharts.com/lib/5/geodata/region/usa/congressional2022/usaCongressionalLow.js';
document.body.appendChild(doc);
/* Adding script from https://cdn.amcharts.com/lib/5/themes/Animated.js */
doc = document.createElement('script');
doc.src = 'https://cdn.amcharts.com/lib/5/themes/Animated.js';
document.body.appendChild(doc);
}
</code></pre>
<p>I then have the map appear in a container "chartdiv" using the following:</p>
<p>(please see first comment since this is capped at 30,000 characters.)</p>
 
Top