locked
Display absolute value in a chart RRS feed

  • Question

  • Hi

    I have created a custom entity with two decimal fields. Think of them as Revenue and Discount. The value in the Discount field will be negative or zero, while the value in the Revenue field Always is positive.

    I would like to create a Bar chart with Revenue and Discount, but I do not want the Discount Bar to be displayed below the zero line. Instead I would like it to be displayed beside the Revenue Bar to make it easier to compare them.

    I have not been able to find a way to get the absolute value of Discount, or multiply the Discount with -1. Is there a way to create my chart?

    Regards

    Peter

    Tuesday, February 25, 2014 4:07 PM

Answers

  • Put the discount on a secondary Y-axis and reverse it by adding IsReversed="true" to its properties.

    You will need to add a minimum and maximum to each axis, to force the axes to be comparable. For example add Minimum="0" Maximum="1000" to the Revenue axis, and Minimum="-1000" Maximum="0" to the Discount axis.

    If you need a dynamically updated axis, I'd suggest you create workflow that converts the discount to an absolute value in a separate field.


    Ulrik,
    Blog: http://crmchartguy.wordpress.com - Exclusively for MS CRM 2011 Charts
    Twitter: crmchartguy

    • Marked as answer by PeterKihlstedt Thursday, February 27, 2014 11:42 AM
    Wednesday, February 26, 2014 5:26 PM

All replies