Question T14019
Visible to All Users

I an getting error index.js:74 Uncaught ReferenceError: SurveyAnalytics is not defined at index.js:74:1

created a year ago
JavaScript
SurveyAnalytics.MatrixPlotly.types = ['pie']; SurveyAnalytics.SelectBasePlotly.types = ['pie']; const survey = new Survey.Model(json); setTimeout(() => { const vizPanel = new SurveyAnalytics.VisualizationPanel( survey.getAllQuestions(), dataFromServer // Use the correct survey data obtained from the server ); document.getElementById("loadingIndicator").style.display = "none"; vizPanel.render("surveyDashboardContainer"); }, 1000);

Answers approved by surveyjs Support

created a year ago

Hello Muaath,
To resolve the error, you need to import the SurveyAnalytics module. Please add the following line of code to the imports section of your component:

JavaScript
import * as SurveyAnalytics from "survey-analytics"; SurveyAnalytics.MatrixPlotly.types = ['pie']; SurveyAnalytics.SelectBasePlotly.types = ['pie']; ... }

Let me know if this code helps.

    Show previous comments (1)

      Hello,
      Please share a complete code for research.

      MA MA
      Muaath Almohaimeed a year ago

        Hi,
        I have solve the above issue and how we can remove the alert banner in js file and where i get the license key

        Thanks

          Hello Muaath,
          Thank you for the update. I'm happy to hear that you solved the issue.

          Regarding the trial banner: as Andrew mentioned in your other thread, you need to follow instructions from the Remove Alert Banner page to remove the alert banner. There is a section specifically targeting the SurveyJS Dashboard. Please review this page. Let me know if you have additional questions.