First of all I am a beginner user in wordpress; The last few weeks I have tried to build a "graph" that will be shown to the user in a Post at the end of a survey. I carried out the survey using the GravityForms plugin, the "Post" where the result of the survey will be displayed next to the graph is automatically created by a GravityForms Add-On after the user presses the "Submit" button. I was able to make the chart using ChartJs after inserting a reference to a CDN in the topic header as follows:
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.9.3/Chart.bundle.min.js" integrity="sha512-vBmx0N/uQOXznm/Nbkp7h0P1RfLSj0HQrFSzV8m7rOGyj30fYAOKHYvCNez+yM8IrfnW0TCodDEjRqf6fodf/Q==" crossorigin="anonymous" referrerpolicy="no-referrer" type="application/javascript"></script>
I made the chart using hooks from functions.php to be able to handle the data that the user inserts in the form and thus insert in the content of the Post an element of type where the chart with the results of the survey will be:
The problem is that this only works when I am logged into Wordpress, when I share the link so that someone else can fill out the survey or when I do it from incognito mode instead of showing me the chart, the Post shows me raw text:
Why is it that I can only see the chart when I am logged into Wordpress?