Monday, September 23, 2013

BIRT Reports - How to Change the Marker Color of a Series on a Chart

Changing the marker color of a data series is easy in Eclipse BIRT, you just have to know where to look. I had to change the default color scheme when I built a chart report with two Y-Axes and more than one data series for the first data set. It seems that when you try to do this, BIRT uses the same color scheme for Axis 1 - Second Series as it does for Axis 2 - First Series.

So my report came up pretty much incomprehensible:




But I wanted something more like this:

 

Here is how I got to that solution:

Step 1: Insert a Chart and Select the Data to Display

I'm not going to go into detail about this step, but if you need further help on how to pull your data, you could start with the official BIRT tutorials. I have also started a BIRT tutorials project as well -click here to go to the start of my BIRT tutorials.

Step 2: The Select Chart Type Tab

In order to get the report to pull multiple Y-Axes, you will need to change the report type to a either a line or bar graph. Once you have made your selection, you will need to click the "Multiple Y Axis" dropdown to add your additional axes.


Step 3: The Select Data Tab

On the Select Data Tab, click "New Series" Under Axis 1 to add a second series of data for the axis. I am using deferred building repair costs and total building cost under the same axis because they share the same unit of measurement and are similar in scale. I am using percentage for the second axis in order to display the total deferred repair costs divided by total building costs. 


Step 4: The Format Chart Tab

Alright! Now that you have built your chart with the data you want presented, now it's time to format it so that it's easily readable.

Step 4a: Changing those pesky Marker Colors

  • On the format chart tab - click "Series"
  • Go to the bottom of the page and click "Series Palette"
  • That will take you to a list of colors for Axis 1. The topmost color is the color for series 1, the second from the top for series 2 and so on.

  • When you click the series color, a drop down list will appear that will allow you to change the color of that series.
  • You will have to click the "Axis 2" tab to change the color scheme for your second axis.
  • Some notes:
    •  I chose to keep blue for the deferral costs (Axis 1 -Series 1). I changed the more static total building costs (Axis 1 - Series 2) to black.
    • Brighter colors will focus attention to them. I changed percentage (Axis 2 - Series 1) to red because it was the actual series that we were trying to monitor. 

Step 4b: Bonus - Changing Series Titles on Your Report Legend

On this same page, you can edit your the titles for each series.



Step 4c: Bonus - Adding the Series Values by Data Point

Since we were tracking the percentage of total deferred maintenance costs compared to total building costs, I wanted to provide as much information at a glance about that percentage.  I added the percentage numerical values by data point in order to display smaller incremental changes. This can be done with a simple click of a check box.

  • Click the "Value (Y) Series" for the specific series that you want to display numerical information.
  • Check the "Show Series Labels" check box.

Step 4d: Bonus - Changing the Marker Type in BIRT

Changing the marker type is another simple change that can make your chart look cleaner and more professional. It also helps differentiate between more than one series on the chart.

  • On the "Value (Y) Series" for the specific series, click the "Markers" button.
  • Use the markers drop down box to customize the marker for that series.


Step 4e: Bonus - Changing Axis Color

Last One! If you only have one series for an axis, you can change the color of the axis to match the color of that series. This can help reduce the confusion of having multiple axes (scales) on a chart.

  • Click the Axis that you want to format.
  • Click the "A" button beside "Labels"
  • Change the color to match the color of the series.


That's all for now! If you have any chart formatting requests, feel free to post them in the comments below!

1 comment:

  1. Hi, I have a marker line. I want to change the color of plot points which are below marker line. Thanks in advance

    ReplyDelete