メインコンテンツへスキップ

How do I give each bar in a report bar chart its own color? - ナレッジベース / Q&A / Reports & DPQL - Deskpro Support

How do I give each bar in a report bar chart its own color?

作成者一覧
  • Kim

Use the itemColors option on the graph in the widget options. The colors option sets one color per data series, so on a chart with one series it only changes the first color.

Why colors only changes one bar

A bar chart grouped by a single field, such as CSAT rating, is one data series. Each value is a separate bar in that series. The colors option gives one color to each series, so only the first color is used.

Color each bar

Add itemColors to the graph in the widget options. For example:

{"legend":false,"graphs":[{"itemColors":["#C0C0C0","#11AC11","#FF0000"],"lineAlpha":0}]}

Colors are applied to the bars in the order they appear, from left to right.

💡 Note: If the order of the bars changes, the colors follow the new order.


参考になった 役に立たない