Visualization Type Selection in SurveyJS Dashboard

Visualization type selection is an interactive feature that allows users to switch between different visualization types (charts, tables, and others) for each dashboard item using a dropdown menu.

Visualization type selection in SurveyJS Dashboard

View Demo

Supported Visualization Types

Visualization type selection is available for all types except Response Count.

Enable or Disable Visualization Type Selection

Visualization type selection is enabled by default. To disable it for the entire dashboard, set the allowChangeVisualizerType property to false when creating a Dashboard instance:

import { Dashboard } from "survey-analytics";

const dashboard = new Dashboard({
  questions: [ /* Survey questions to visualize */ ],
  data: [ /* Survey responses to aggregate */ ],
  items: [ /* Dashboard item configurations */ ],
  allowChangeVisualizerType: false // Disables visualization type selection globally
});

To override this setting for a specific dashboard item, set its allowChangeType property. Item-level settings take precedence over the global configuration.

import { Dashboard } from "survey-analytics";

const dashboard = new Dashboard({
  questions: [ /* ... */ ],
  data: [ /* ... */ ],
  allowChangeVisualizerType: false, // Disable globally
  items: [
    {
      name: "question1",
      allowChangeType: true // Re-enable for this item
    },
    // ...
  ]
});

Change Visualization Type Programmatically

To define visualization types in code, set the type property when configuring dashboard items:

import { Dashboard } from "survey-analytics";

const dashboard = new Dashboard({
  questions: [ /* Survey questions to visualize */ ],
  data: [ /* Survey responses to aggregate */ ],
  items: [
    {
      name: "question1",
      type: "bar"
    },
    {
      name: "question2",
      type: "pie"
    },
    {
      name: "question3",
      type: "nps"
    }
  ]
});

You can also change the visualization type at runtime. The target type must be included in the availableTypes array for the item. This means it should either be enabled by default (when items are auto-generated) or explicitly listed in availableTypes (when you configure dashboard items manually).

import { Dashboard } from "survey-analytics";

const dashboard = new Dashboard({
  /* Dashboard configuration */
});

dashboard.getItem("question1").type = "doughnut";

Restrict Available Types

Use the availableTypes array to control which visualization types users can select:

import { Dashboard } from "survey-analytics";

const dashboard = new Dashboard({
  questions: [ /* Survey questions to visualize */ ],
  data: [ /* Survey responses to aggregate */ ],
  items: [
    {
      name: "question1",
      type: "vbar",
      availableTypes: [ "vbar", "pie" ]
    },
    // ...
  ]
});

Other Interactive UI Features

Send feedback to the SurveyJS team

Need help? Visit our support page

Your cookie settings

We use cookies to make your browsing experience more convenient and personal. Some cookies are essential, while others help us analyse traffic. Your personal data and cookies may be used for ad personalization. By clicking “Accept All”, you consent to the use of all cookies as described in our Terms of Use and Privacy Statement. You can manage your preferences in “Cookie settings.”

Your renewal subscription expires soon.

Since the license is perpetual, you will still have permanent access to the product versions released within the first 12 month of the original purchase date.

If you wish to continue receiving technical support from our Help Desk specialists and maintain access to the latest product updates, make sure to renew your subscription by clicking the "Renew" button below.

Your renewal subscription has expired.

Since the license is perpetual, you will still have permanent access to the product versions released within the first 12 month of the original purchase date.

If you wish to continue receiving technical support from our Help Desk specialists and maintain access to the latest product updates, make sure to renew your subscription by clicking the "Renew" button below.