Bar Chart Interval

  • Hi ,

    I am having an issue with one of the SSRS 2008 R2 bar charts.

    I want to Divide the Y axis in 10 equal parts always ,

    e.g If min =0 , max=100 Then scale should be 0,10,20...,100

    e.g if min =0 , Max =200 Then Scale should be 0,20,40.....,200

    The Max value can have any value e.g 2000

    I do not want to change the Min and Max value for the Chart but I want to write an expression for the interval property so that it becomes dynammic and always divide the Y axis in 10 equal part.

    Can anbody Please help on the above issue.

    Thanks

  • using the following as test data

    DECLARE @TestData TABLE

    (

    WhatData NVARCHAR(10) ,

    SomeValue BIGINT

    )

    INSERT INTO @TestData

    ( WhatData, SomeValue )

    VALUES ( N'Value 1', 10 ),

    ( N'Value 2', 50 ),

    ( N'Value 3', 200 ),

    ( N'Value 4', 60 ),

    ( N'Value 5', 20 )

    SELECT * FROM @TestData

    Note this is way more difficult if you actually need to do some grouping and summing up on the chart. This appears to work when the results are all nice and pre-done for you in the code 🙂

    Attached is an image of the output you get.

    Set two expressions:

    Interval

    =max(Fields!SomeValue.Value)/10

    Maximum

    [max(SomeValue)]

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply