Change X-axis(Time axis) according to my date range filter.

My issue is when I choose last than one hour in my date range filter my bar graph should appear corresponding to minutes. when I choose the last 6 hours or 12-hour bar graph should appear corresponding to the hour and when I choose one day or more than one day then the bar graph should appear corresponding to the day. Is this possible to achieve in Dundas via scripting or anything another way? Please guide.

Hi Anupam,

For the bars themselves to correspond to minutes, hours, or days, you would need the data itself to be grouped into these time periods or levels. It’s easy to allow users to do this without scripting by adding a hierarchy level filter for them to choose the level for themselves, but otherwise you can use script similar to what we have in our script library.

If your filter is a Calendar Range, your parameter is a range member value type, and uses the MemberValue type in the parameterValue.lowerBoundaryValue/upperBoundaryValue properties. We have a sample here that demonstrates setting these properties (but you would probably read them). You can get the corresponding date value from the memberTime property on those member values.

A Range Date filter normally uses a range DateTime parameter value type, which stores date values directly in its lowerBoundaryValue/upperBoundaryValue. We have a sample here that sets these properties to dates instead of reading them. (As documented, these dates are always offset to represent the selected date and time in UTC.)

You can then set the level as done in this sample.

Hopefully this is pointing you in the right direction.