Hello everyone,
as the title already explains the question I have, I still want to provide some context.
I am using the amcharts5 libary for creating dynamic maps for my blog. As I have a CMS connected to it I wanted to ask if the following is possible and if so, how.
Map.astro
---
// getting data from CMS (filler)
const data = "germany";
let country;
if (data == "germany") {
country = "de_DE";
}
---
<div id="chartdiv"></div>
<script>
import * as am5 from "@amcharts/amcharts5";
let root = am5.Root.new("chartdiv");
root.locale = country;
/// simplified example
</script>
I am not able to do everything in the code fences because amcharts does not work that way. I would like to access Astro variables aswell in the <script> Tag but that does also not seem to be possible.
Am i missing something major or is my apporach just not possible.
Thanks in advance,
David