Step 9 - Set Chart Colors
Tutorial 1 for Pro Version: Aggregate and Visualize Your Data
Step 9 - Set Chart Colors
Although there is a very quick, easy way to set your chart's colors using the "Color Palette" feature, it is best practice to tie your chart's colors to the chart's series levels. Otherwise, you could end up with something like this:

If you cut corners, your colors will get misaligned when the report is run for a dataset in which not all your chart's series/performance levels are represented.
Setting Your Chart's Colors, The Right Way
We will use Bucket Properties to set the chart's colors, just like we did to set the chart's labels in Step 8. It's almost the exact same process we completed in Step 8.
Get HEX Codes
To start, you'll want to get the HEX codes for the colors you want to use.
Use this color picker tool to get the hex codes for whatever colors you want. Or, use these Hex codes if you don't want to bother picking colors right now:
Red: #C13D3D
Yellow: #F5D82A
Green: #1CB931
Blue: #368DD9
Gray: #C9C9C9
Create "color" Bucket Property
Double-click on your chart
Click Chart Data > Configuration
Double-click on the Series Levels you created
Click Bucket Properties
Click Add
Set Property name to "color"
Click on the Pencil Icon to bring up the Expression Editor
Enter the following expression:
$F{2016-2017 SBA Summative (Final) ELA Performance Level}==null
? "#C9C9C9"
$F{2016-2017 SBA Summative (Final) ELA Performance Level}==1
? "#C13D3D"
:$F{2016-2017 SBA Summative (Final) ELA Performance Level}==2
? "#F5D82A"
:$F{2016-2017 SBA Summative (Final) ELA Performance Level}==3
? "#1CB931"
:$F{2016-2017 SBA Summative (Final) ELA Performance Level}==4
? "#368DD9"
:"black"
Refer to Basics of Writing Expressions in JSS for detailed documentation on writing expressions in JSS.
Click Finish

Set Advanced Property
Whenever you create a bucket property, you need to pass the property to a measure.
Double-click on the Measure you created
Click Advanced Properties
Click Add
Set Contributor to "SeriesProperty" (Use drop down menu)
Set Property name to "color" (all lowercase, the property name is case sensitive)
Select Use Bucket Value
Select the "color" Bucket Property you just created
Click OK

Now, preview your report. The chart's colors have now been customized.

Last updated
Was this helpful?