Showing results for 
Search instead for 
Do you mean 
Community Home Request Access Read Blogs Share Your Ideas Search Community View My Settings
Reply
Highlighted
Employee
Posts: 191
Registered: ‎03-13-2009
Accepted Solution

Dashboard Widgets - Controlling the Result

Has anyone worked on the Dashboard widgets to deliver an output such as below

 

I would like to display a chart of Opportunties by Account Manager, in the database i have more than 10 users associated with various opportunites. The out of box dashboard widget generates a chart for top 10 count of account mangers. I know by having more than 10 users in the dashboard widget it may have display and performance related impact. However is there a way to make this work to display for example top 15 or top 20?

 

Cheers

Kannan

Highlighted
Silver Super Contributor
Posts: 801
Registered: ‎03-24-2009

Re: Dashboard Widgets - Controlling the Result

[ Edited ]
Yes, it's actually soft-coded as a limit of 10 - but can be changed to any number you wish (10 is suitable due to size of graph). If you look in the code you'll find that the limit is set via a constant (MaxUsers or something). Just change this to the number you need.
Highlighted
Employee
Posts: 191
Registered: ‎03-13-2009

Re: Dashboard Widgets - Controlling the Result

it definetely does not look like MaxUsers, would you be able to let me know the exact property?

Highlighted
Silver Super Contributor
Posts: 801
Registered: ‎03-24-2009

Re: Dashboard Widgets - Controlling the Result

Yep, give me 2 mins...
Highlighted
Employee
Posts: 191
Registered: ‎03-13-2009

Re: Dashboard Widgets - Controlling the Result

Ok i think i have found the answer it seems the variable "qsParams" when uncommented will yield the number of records for which the chart is generated.


Cheers

Kannan

Highlighted
Silver Super Contributor
Posts: 801
Registered: ‎03-24-2009

Re: Dashboard Widgets - Controlling the Result

Open scripts: Dashboard: Content Set Support L306: mMaxRows = 5 However, I've found that it's easier to simply adjust L1840 If mMaxRows = 0 Then strSelect = "SELECT DISTINCT " 'DNL Else strSelect = "SELECT DISTINCT TOP " & mMaxRows & " " 'DNL End IF to ' If mMaxRows = 0 Then ' strSelect = "SELECT DISTINCT " 'DNL ' Else strSelect = "SELECT DISTINCT TOP 15 " 'DNL ' End IF As adjusting the constant doesn't always work for all dashboards. Whereas the change above always does.
Highlighted
Employee
Posts: 191
Registered: ‎03-13-2009

Re: Dashboard Widgets - Controlling the Result

Thanks mike, I shall try both the options to see which one works and solves my problem

Highlighted
Employee
Posts: 191
Registered: ‎03-13-2009

Re: Dashboard Widgets - Controlling the Result

[ Edited ]

Ok now that the qsParams option helps me in adding more than 10 users or data points the graph is really coming out ugly, is there a way by which the height and width of the graph object can be controlled?

 

 

Bar Charts with more than 10 Data Points

 

Highlighted
Employee
Posts: 191
Registered: ‎03-13-2009

Re: Dashboard Widgets - Controlling the Result

Mike your solution I understand is for the LAN client dashboards, my question is in context with the Web dashboard widgets. Has someone worked on the dashboard widgets to customize the height and width of the chart area along with the bars or pies to make it more clear?

 

Regards

Kannan

Highlighted
Nickel Contributor
Posts: 59
Registered: ‎07-30-2010

Re: Dashboard Widgets - Controlling the Result

[ Edited ]

Hello Kannan,

 

Sorry to bring an older thread back up to the top - I was working on a solution to the problem of height when adding more data points and thought I would share my solution;

You can use the "prefHeight" property to change the height of the graph, raise the value by 0.3 per 5 data points added to the graph, this will however increase the height on ALL bar graphs, etc. Even those with 2 data points.

A better solution to this problem would be to make a dynamic height based on the amount of data points you have, you can carry this out by changing the "height:" line to:

height: (function()  {  return (config.data.total_count > 10) ? Math.floor(width * (config.data.total_count * 0.06)) : Math.floor(width * 0.4); } ()),

 


Once the above line is implemented, the bar graph will display as many data points as you have (upto the limit, remember to change the "limit" value) while changing the height of the graph to match your data points.

Hope this helps.
PS: I carried this out for a client today, the do however use 7.5.3, this should however work the same on 7.5.4!

Thanks,
Richard Anderson

Richard Anderson
CRM Consultant
K3 CRM