Legend-Based Series Toggling
Legend-based series toggling is an interactive feature that allows users to show or hide individual data series in multi-series charts by clicking legend items. This is useful when charts display multiple series and users need to focus on specific data or reduce visual clutter.
Supported Visualization Types
Configure the Legend
Series toggling is enabled by default and cannot be disabled. You can, however, change the legend position for better layout.
By default, the legend is displayed on the right. To reposition it, set the legendPosition property to "left", "top", or "bottom". You can apply this setting globally when creating a Dashboard instance or override it for individual items via the visualizer object:
import { Dashboard } from "survey-analytics";
const dashboard = new Dashboard({
questions: [ /* ... */ ],
data: [ /* ... */ ],
legendPosition: "bottom", // Apply globally
items: [
{
name: "question1",
type: "stackedbar",
visualizer: {
legendPosition: "right" // Override for this item
}
},
// ...
]
});
Other Interactive UI Features
Send feedback to the SurveyJS team
Need help? Visit our support page