Search code examples
sqlt-sqlreporting-servicesssrs-2008ssrs-2008-r2

Change order of horizontal axis in SSRS scatter chart?


My SSRS scatterchart looks like the following. The horizontal axis shows the hours, in this case Hr 0-14.

So I'm trying to change the order of the horizontal axis, so it goes from recent to older (ie. 14-0).

I went to Category Groups, then to Sorting, and changed the Order of dimhour from A to Z to Z to A. Nothing changed.

The tsql script also returns the data ordered by DimHour Desc. Nothing changed with that either.

What else can I do? Here's the test query used for the scatterchart:

select  1 as 'dimhour',  9 as 'dept', 99.567 as 'Percent'
union
select  4 as 'dimhour', 13 as 'dept', 99.741 as 'Percent'
union
select 11 as 'dimhour', 16 as 'dept', 99.374 as 'Percent'
union
select 11 as 'dimhour',  7 as 'dept', 99.706 as 'Percent'
union
select 11 as 'dimhour',  4 as 'dept', 99.575 as 'Percent'
union
select 14 as 'dimhour',  1 as 'dept', 99.741 as 'Percent'
order by dimhour desc

This is how it looks:

enter image description here

Edit:

I tried a solution that Hannover Fist suggested (set Horizontal Axis set to Scalar), and it sorta works, but it doesn't display the hours in intervals. As you can see, it doesn't display in 1-unit intervals, even though it's set that way in the Horizontal Axis properties (Interval = 1).

enter image description here

Thanks.


Solution

  • It works for me when I create a new table.

    My guess is that you have the Horizontal Axis set to Scalar. This seems to sort it based on the value regardless of the Sort on the Category.

    Changing the Axis Type to Category should make it work correctly.

    enter image description here