4 Replies Latest reply: Oct 2, 2012 8:17 AM by Sara Saltin RSS

    Hide gauge indicator/needle when expression is null.

      I'm trying to hide/show the indicator of a gauge chart depending on what the expression calculation results in. The min val of the gauge is 0 (as in 0 %) and max val is 100 (as in 100 %). The gauge chart shows how many activities of a certain type that started in time.

      If 3 of 4 activites started in time the indicator will point at 75 %.

      If 0 of 4 activities started in time the indicator will point at 0 %.

      But if there are no activities of the certain type, i.e. 0 of 0 activities started in time, I want to hide the indicator since it would be incorrect to say that 0 activities started in time. The result is actually null.


      I use a macro to hide/show the indicator:


       set chart = ActiveDocument.GetSheetObject("CH616")
       set props = chart.GetProperties
       set gaugeSettings = props.ChartProperties.GaugeSettings
       gaugeSettings.GaugeShowIndicator = false
       chart.SetProperties props


      The problem is that I can't find a way of reading the expression result in the macro. I should need something like the bold text below:


      if chart.getexpression("ActivitiesStartedInTime").value = null() then

           gaugeSettings.GaugeShowIndicator = false


           gaugeSettings.GaugeShowIndicator = true

      end if


      Is there a way of doing this or is it possible to achieve what I want with another approach?