Skip to main content
Question

Is there a way to just display top 10 results in a bar graph?

  • April 6, 2017
  • 0 replies
  • 595 views

Is there a way to just display top 10 results in a bar graph?
This topic has been closed for replies.

  • Quickbase Alumni
  • April 6, 2017
Go to this ugly chart:

https://haversineconsulting.quickbase.com/db/bgcwm2m4g?a=q&qid=84

Paste this code into the console:
var chart = Highcharts.charts[0];
var options = chart.options;
chart.destroy();
options.xAxis[0].categories = _.filter(options.xAxis[0].categories, function(item, index) {
  return index < 10;
});
options.xAxis[0].labels.step = 1;
options.series[0].data = _.filter(options.series[0].data, function(item, index) {
  return index < 10;
});
new Highcharts.Chart(options);
See screenshot of resulting Chart.



Then apply the Un-HighCharted Waters technique with the above code as described here:

https://community.quickbase.com/quickbase/topics/what-is-the-hylo-technique

If you needs additional assistance feel free to contact me off-world using the information in my profile:

https://getsatisfaction.com/people/dandiebolt

  • Quickbase Alumni
  • April 11, 2017
If script is not for strength, you can do this with native relationships and formulas.  It might not always show the top 10, but it will dynamically show your top % of results, and you can set that % to whatever you'd like.

  • Quickbase Alumni
  • April 12, 2017
Sania,

Can you provide an example of the report you are trying to make? 
I'm just looking for some of the defining factors that will dictate the needed set up.  
For example, is it a report of Projects grouped by category, client, or area, etc?

We will need to summarize all the data, then divide the data by its count so you can have a %, then set a % threshold, but I can provide more details if you have some more info for me.

.... or you can use a script...  I'm sure Dan would love to help.

Hi Matthew, I know this thread is 2 years old but I have the same question, except trying to draw out the top 5 on a bar chart. I was able to generate the bar chart that rates agent sales from highest to lowest, I just need to be able to display the top 5. Is there a formula I can enter in the chart formula box to display top 5? 

I believe you need to use Evan�s solution.

  • Quickbase Alumni
  • May 16, 2019
I'm seeing an error with the above bar chart code;
Uncaught TypeError: Cannot set property 'options' of undefined.  
Has something changed in QB?
Sure this worked before.