In SQL server 2008 there are several new chart options. The Box Plot Chart or, Box and Whiskers Chart, or Candle Chart need a few calculations to make the chart work. The chart is made to show a series of numbers. Most box plot charts look like:

This is a representation of a series of numeric data broken down by date. To explain how the chart is made we need to understand how the numbers are calculated. Lets assume on one day we have the numbers (3,7,8,**9**,12,15,16,**19**,21,25,22,**23**,26,30,35). We need five values from this field, Median, Max, Min, Lower Quartile and Upper Quartile. We may also have numbers that could be consider outliers if they are too large or small compared to the rest of the numbers. Usually this is 1.5 times the nearest Quartile.

The median is the number in the center of the numbers. In our example we have 15 numbers. The center number is the eighth digit which is 19. If the series of number is an even amount then the number would and average of the two center numbers. So if there are 14 numbers in the series the 6th and 7th digits would be averaged together to get the median.

The next two numbers are the quartiles. These are the numbers half way between the median and the the highest and lowest numbers. Again if there are an even amount of numbers you take the average of the two center numbers. In our example the lower quartiles is 9 and the upper quartile is 23.

The last two numbers are the minimum and maximum , in this case 3 and 35 respectfully.

Once we have these numbers we can build the Box Plot chart. Reporting services does not do a good job of calculating these numbers. The best thing to do is have analysis services calculate these for you or use a stored procedure to produce them. Lets assume we have a table that has these numbers calculated like so:

Q1 is the Lower Quartile, Q2 is the upper Quartile.

Now we create a report with a data source and a dataset querying all the data from this table.

Next we drag in a chart to the report and select the Box Plot Chart.

Then we drag the Date Column from our Dataset into the Category field below the chart.

Then we drag the Max Column from our Dataset into the Data Fields above the chart.

Then right click on the [Sum(#Max)] Grey box that was created in the Data Fields above the chart and select Series Properties.

Click on the function button next to the fields and set the High Value to Max, set Low to Min, set Open to the Lower Quartile(Q1), and set Close to the upper Quartile(Q2).

Adjust the formatting of the X and Y axis as desired and the labels and the chart should look like so:

If we want the Median to show on the chart we need to add it as another series to the chart. Drag the median column from the dataset into the Data fields above the chart. Make sure you do not drop it on one of the existing series, place it to the right of them. It automatically sets it to Sum(median), we need to change this so it is just the median field. Right click on the Median series and select Series Properties.

Click on the function box next to the High value and change the function to =(Fields!Median.Value). Then Click on the markers node on the left and select the desired marker type, size and color. Click on the fill node and set the color to no color. This will stop the line from appearing below the median. The report should look like so:

To add the Outliers. We follow the same steps we did to add the median markers. Make sure to set the fill to no color.

The final results look like so:

I removed the max field from the legend also. I did this by right clicking on one of the blue boxes and click series properties and setting the legend to do not show.

Hi mike,

I have some questions on Box Plot please help me with this..

1) Is it possible to show 0th, 25th,50th,75trh and 100th percentiles

2) can you provide some indication of 10 nad 90th percentiles? reason is that we want to visually show if the x falls in the Top 10 or bottom 10 percentiles

3) IS it possible to place a label for x mark

thanks

It can be done but it should be done in the dataset. You will need a column for the 2th, 50th... percentiles. You can show the label by right clicking on the series and selecting show labels.

thanks Mike...i've some more questions if you could answer.

1. Is it possible to create horizontal box and whisker rather than vertical?

2. We want to highlight only one observation in the series. Is it possible to provide an X mark or some other indication on the box and whisker to highlight this observation.

3. Is it possible to show the percentile, a label and the value of an observation on the chart?