Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dashboard - Introduce an option to easily colorize dashboard using custom colors #385

Open
JaneSjs opened this issue Dec 18, 2023 · 1 comment
Assignees
Labels
enhancement user issue An issue or bug reported by users

Comments

@JaneSjs
Copy link
Contributor

JaneSjs commented Dec 18, 2023

T16054 - Changing the background color of a graph
https://surveyjs.answerdesk.io/internal/ticket/details/T16054


In the meantime, the overall Dashboard look can be customized from different places.

  • A background of a dashboard's container defines the background of the container.
<div style="background: #1f2420" #surveyVizPanel></div>
  • The VisualizationPanel's backgroundColor property defines the background of certain charts.
vizPanel.backgroundColor = "gray";
VisualizerBase.customColors = [
  "#f3cec9",
  "#e7a4b6",
  "#cd7eaf",
  "#a262a9",
  "#6f4d96",
  "#3d3b72",
  "#182844",
  "#6f4d96",
  "#3d3b72",
  "#182844",
];
  • To define colors of charts, it is necessary to specify the plot_bgcolor and paper_bgcolor colors within the onPlotCreating event.
PlotlySetup.onPlotCreating.add((model, options) => {
  options.layout.plot_bgcolor = "gray";
  options.layout.paper_bgcolor = "gray";
});
  • Additionally, define the sa-question__content background color.
.sa-question__content {
  background: gray !important;
}
  • To colorize toolbar items, it is necessary to apply additional style customization.
.sa-question__select-wrapper .sa-question__select {
  background: gray !important;
  border-color: gray !important;
}

As a result, we can achieve a dark mode for a dashboard: View Demo.
image

Provided the complexity of Dashboard appearance customization, I would suggest considering creating a kind of a theming mechanism which would allow developers to modify the appearance of a dashboard with ease.

@JaneSjs JaneSjs added enhancement user issue An issue or bug reported by users labels Dec 18, 2023
@tsv2013 tsv2013 self-assigned this Dec 19, 2023
@AndOne1974
Copy link

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement user issue An issue or bug reported by users
Projects
None yet
Development

No branches or pull requests

3 participants