Creating a unique count histogram

I am trying to make a histogram with unique counts for a given field (lets call this field Source). However, it seems Kibana only treats Source as unique within each bucket of the histogram, but not between buckets. How can I make the histogram pick a unique record (preferably, one with a maximum value of the field I am making the histogram for) for each Source?

Lets say my data looks like the following:

Source        ActivityCount
A                  10
A                  30
B                  50
B                  20
C                  50

I want to create a histogram that would describe the following subset of the data:

Source        ActivityCount
A                  30
B                  50
C                  50

It seems like this should be trivial to do, am I missing something very basic here?

Hmm, couldn't you just choose max ActivityCount for the metric, and do a terms on the Source for the buckets?

So that's actually what I've done so far, verbatim. However, this is not a great way to visualize this data, particularly since the data set is quite large, so there are many values. I need to restructure this data into a histogram so that I can actually see how the data is distributed instead of looking at the individual values.