How to give color to each sub category bar in Bar Chart?

It looks like you’re trying to customize the colors of your bar chart in Grafana based on different education categories within salary categories. Here are some suggestions to help you achieve your goal:

  1. Ensure Correct Data Grouping: Your query looks correct for grouping the data by income and education levels. Ensure that the data is being returned as expected.
  2. Using Overrides in Grafana:
  • Go to the Panel settings of your bar chart.
  • Navigate to the Overrides tab.
  • Add an override and select the field (series) you want to change.
  • In the override options, set the color for each series.
  1. Color Scheme Configuration:
  • In the Display options of your bar chart, you can set the color scheme to ‘By Series’.
  • This will allow Grafana to automatically assign different colors to each series (education level in your case).
  1. Thresholds for Custom Colors:
  • If you want specific colors for each education level, you might need to use the Thresholds option.
  • Define thresholds for each education category and assign the desired color.
  1. Example Configuration:
  • For each education level, add an override and assign a unique color:
    • Senior High School: Color #1
    • College: Color #2
    • Master: Color #3
    • Doctorate: Color #4
  1. Documentation and Tutorials:
  • You mentioned you followed the Grafana documentation. Double-check the Grafana Bar Chart Documentation for additional details on configuring colors and overrides.
  1. Visual Examples:
  • It might help to look at examples or screenshots of similar configurations. If available, share or look for community posts or tutorials that illustrate how to set up colored bar charts with multiple categories.

By following these steps, you should be able to configure your Grafana bar chart to display different colors for each education category within the salary categories.

1 Like