Changing icon for a single data point in a ranking chart

I’m working to replicate this ranking chart, which shows the relative amount of work done by team members:

So far I’ve created a ranked display that shows all of the members of team:

image

What I’m lacking is the ability to change the icon from a circle to a triangle for a single team member. When complete, this will be the team member that is looking at the dashboard.

What I think I need is logic on the order of “If (this team member) then (change the icon to a triangle”

Can Dundas do this?

Yes you can do this by dynamically setting up the state for a particular team member. I am not entirely sure about your requirements or your visualization structure, but if you want the indicator to point to the specific user row depending on user login information, the visualization should have user_id/user_name (depending on login info) in data analysis panel. Please follow the steps:

  • Create a parameter placeholder in the metric set which will be used to hold the user_id dynamically. Parameter placeholder is an interesting and important feature, it is well explained in this article: https://www.dundas.com/support/learning/documentation/analyze-data/formulas/adding-formulas#parameters

  • Add a formula measure: if ($user_id$==$param$) {return 1;} else return 0; This will ensure cell value 1 when user_id dimension has value equal to logged in user,

  • Add states to your visualization based on value 1 in the formula measure created in previous step. There’s no need of default state indicators since we just need one indicator.

  • Add a SingleNumber/SingleString type viewParameter in your dashboard and connect it with the parameter placeholder and the calculated formula measure. this viewparameter will set the $param$ value.

  • Now, to assign user_id to the parameter, on dashboard ready, add a script:
    var viewParameter = this.parentView.control.getViewParameterByName(’’);
    viewParameter.parameterValue.clearTokens();
    viewParameter.parameterValue.clearValues();
    viewParameter.parameterValue.value = window.dundas.context.currentSession.accountDisplayName.split(" ")[0]; //account display name or ID, depends on your usecase
    viewParameter.invalidateParameterValueLastModifiedTime();
    viewParameter.refreshAllAdapters();

In my example, I am setting IDs on dashboard load and it looks like below. Hope this helps.
image

1 Like