Jump to content

Reset hierarchy slider on bar chart using IronPython


B I

Recommended Posts

Hi all,

I need to reset a bar chart so that the categorical axis, which is a four-tiered hierarchy, is programmatically reset to the "least specific" level. How can I go about doing this

The only way I can think to do this is:

barChart.As[barChart]().XAxis.Expression = barChart.As[barChart]().XAxis.Expression.replace("3","0").replace("2","0").replace("1","0")The issue is that it is difficult to write an expression for a chart on a categorical axis if the axis requires an alias. Thus, in the above, I edit the existing expression to change any value of "hierarchy level" to 0. It isn't a very good way to achieve this as it requires me to replace every value level individually, meaning that if more levels are added to the hierarchy then I will need to add these values as a separate replace function.

Does anyone know of a better way to achieve this

Cheers,

Ben

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...