Illuminate BI Tool Guide
  • Introduction
  • Example BI Reports
  • What is BI Reporting in Illuminate?
  • Getting Started Using BI with Custom Reports
    • Setup Jaspersoft Studio
    • Prepare Your Data Set
    • Create a Basic Jasper Report
    • Publish My Report to Illuminate
    • Edit Report After Publishing
    • Display Selected Filters on Your Report
  • Get Started Using BI with SQL
    • Access Data Via ODBC Connection
    • Learn the Schema
    • Setup Jaspersoft Studio for SQL
    • Create a Basic Report with SQL
    • Publish My Report (SQL Method)
    • Adding Input Controls
  • Tutorials
    • Tutorials for Free Version ("Community Edition")
      • Tutorial 1: Categorize and Aggregate Your Data
      • Tutorial 2: Using Jasper Report Bands
      • Tutorial 3: Student Roster Report
      • Tutorial 4: Student Roster with SQL
      • Tutorial 5: Summary of Performance
      • Tutorial 6: CELDT Longitudinal Summary
    • Tutorials for Pro Version ("Professional Edition")
      • Tutorial 1: Aggregate and Visualize Your Data
        • Step 1 - Create a Custom Report
        • Step 2 - Download Your Data
        • Step 3 - Create a Data Adapter
        • Step 4 - Duplicate Template. Link Data Adapter
        • Step 5 - Set Class for Numeric Fields
        • Step 6 - Add & Configure Chart
        • Step 7 - Resize Chart. Preview Report.
        • Step 8 - Change Chart Labels
        • Step 9 - Set Chart Colors
        • Step 10 - Repeat for Other Data Points
        • Step 11- Install Your Report
      • Tutorial 2: Using Report Bands
        • Step 1 - Duplicate Report from Tutorial 1
        • Step 2: Create Your Group
        • Step 3: Create a Sort Field
        • Step 4 - Copy & Paste Your Chart
        • Step 5 - Set Reset Type and Evaluation Time
        • Step 6 - Change the Category Level
        • Step 7 - Add Site Name Field
        • Step 8 - Grade Level Sorting
    • CrossTabs Tutorial - Create, Format, and Style a CrossTab
      • Step 1 - Create Your CrossTab
      • Step 2 - Size and Position Your CrossTab
      • Step 3 - Format and Style Your CrossTab
  • Homework 1 - BI Workshop Follow Up
  • BI Tool Cheat Sheet
  • JasperSoft Studio Tips, Tricks, & FAQs
    • Basics of Writing Expressions in JSS
    • Rounding Decimals
    • Working with Dates in JSS
    • Conditional Styling in JasperSoft
    • Custom "No Data" Message
    • Create Multiple Summary Bands
    • Create Hyperlinks or "Tabs" to Connect Sets of Reports
    • JSS Community Edition
      • Adding Data Labels to Your Chart
      • Customizing Colors in Your Charts
    • JSS Professional Edition Only
      • HTML5 Charts
        • Data Labels: Enable, Customize, & Round Data Labels
        • Tooltip: Customizing the Tooltip
        • Keeping Colors Consistent in HTML5 Charts
        • Adding Drill Down to a Chart
        • Prevent Tooltip from Being Cut Off
        • Sort the Bars in Your Stack - Ordering the Series in Your Chart
        • Passing Parameters/Data Between Datasets with HTML5 Charts
        • Add Plot Lines to your Chart
        • Add Colored Zones or Plot Bands to Your Chart
        • Change Bar Colors Based on Bar Value
    • Rolling Over Your BI Tool Reports
    • "Current" Columns in Custom Reporting - To Use or Not to Use?
  • Report Design Best Practices
  • Installing the Illuminate Font Set
  • Report Templates
    • Blank Templates - Report Starters
    • Using the Report Templates
    • Multiple Measures Site Comparison Report (Tutorial 5)
    • EL Reclassification Report
    • EL Reclassification Report v2
    • RFEP Monitoring Report
    • Student Rubric Template
    • Michigan Report Templates
      • PSAT and SAT College Readiness Report
  • BI Tool User Community
Powered by GitBook
On this page
  • Set JSS Property
  • Add Plot Bands to Your HTML5 Chart

Was this helpful?

  1. JasperSoft Studio Tips, Tricks, & FAQs
  2. JSS Professional Edition Only
  3. HTML5 Charts

Add Colored Zones or Plot Bands to Your Chart

PreviousAdd Plot Lines to your ChartNextChange Bar Colors Based on Bar Value

Last updated 5 years ago

Was this helpful?

Do you want to create colored "zones" in your chart? Here's an example:

Creating colored plot bands in your charts requires a little bit of JavaScript, but don't worry. All you have to do is copy and paste the JavaScript code, and enter a few values.

But first, you have to enable a property in Jaspersoft Studio in order to allow JavaScript functions.

Note: If you have already enabled this property for previous reports, there is no need to do so again. Enabling this property needs to be done only once.

Set JSS Property

Open JSS and go to “Properties” or “Preferences”. On a Mac, it’s “Preferences”, but on a PC, it might be “Properties”. I think it’s under the “Window” menu on a PC.

Once you have the Properties/Preferences window open:

  1. Unfold the Jaspersoft Studio Section

  2. Select “Properties”

  3. Click “Add:

  4. Paste in the following for “Property Name”: com.jaspersoft.jasperreports.highcharts.function.properties.allowed

  5. Set the value to: true

Add Plot Bands to Your HTML5 Chart

Now, to add plot bands to your chart:

  • Double-click on your chart

  • Click Show Advanced Properties

  • Click Add

  • Set the Property name to: xAxis.plotBands OR yAxis.plotBands

  • Check the "Use an expression" box

  • Click the pencil icon to the right of the "Property value" field

  • Copy & Paste the code below into the Expression Editor:

"(function(){return ["+
    "{"+
        "from: 0,"+
        "to:3,"+
        "color: '#FFFFEA',"+
        "label:"+ 
            "{"+
                "text: 'Zone 1',"+
                "align: 'center',"+
                "verticalAlign: 'top'"+
            "}"+
    "},"+
    "{"+
        "from: 3,"+
        "to: 6.5,"+
        "color: '#F2FDFF',"+
        "label:"+
            "{"+
                "text: 'Zone 2',"+
                "align: 'center',"+
                "verticalAlign: 'top'"+
            "}"+
    "}"+
"]})()"
  • Now, adjust the values in the code to your liking.

    • The "from" and "to" values will determine where your plot bands start and end.

      • For plot bands on your xAxis, the "from" and "to" corresponds to the index of your categories. Indexes start at 0, so your first category is 0, your second category is 1, etc.

        • You can even enter a value in ".5" increments to move the edge if your plot band over if you'd like.

      • For plot bands on your yAxis, the "from" and "to" simply correspond to the values of your yAxis.

    • The "text" value will determine the label for each of your plot bands.

    • The "align" and "verticalAlign" values can be set to center, left, or right. This will allow you to move the label around in the plot band so the text shows up where you want.

The example above creates TWO plot bands, but you can create as many plot bands as you need.

For example, this code would create THREE plot bands.

"(function(){return ["+
    "{"+
        "from: 0,"+
        "to:3,"+
        "color: '#FFFFEA',"+
        "label:"+ 
            "{"+
                "text: 'Zone 1',"+
                "align: 'center',"+
                "verticalAlign: 'top'"+
            "}"+
    "},"+
    "{"+
        "from: 3,"+
        "to: 6,"+
        "color: '#F2FDFF',"+
        "label:"+
            "{"+
                "text: 'Zone 2',"+
                "align: 'center',"+
                "verticalAlign: 'top'"+
            "}"+
    "},"+
    "{"+
        "from: 6,"+
        "to: 10,"+
        "color: '#F2FDFF',"+
        "label:"+
            "{"+
                "text: 'Zone 3',"+
                "align: 'center',"+
                "verticalAlign: 'top'"+
            "}"+
    "}"+
"]})()"

The FIRST line and the LAST line of the code should always stay the same.

The syntax can be a bit tricky, so don't hesitate to reach out for help if you get lost in the syntax! Simply email help@illuminateed.com.