I have a few million documents in an ElasticSearch index with some numeric fields, say foo and bar. Is there any way to use Kibana 4 to create a graph with foo values on the X axis and bar values on the Y axis? Like a very, very basic chart one might create using Excel.

I'm fine with sampling/aggregations of some kind. I understand that these tools won't show me a plot with 20 million data points. I'm just trying to see if there's some obvious relationship between foo and bar by creating a graph.

share|improve this question

To just plot the correlation between revenue and employee count I would just use a line chart like this:

simple line chart

In order to justify creating a scatter plot chart though (since they're awesome and I wanted to) I generated some fake data that looked something like this:

{
  name: faker.company.companyName(),
  employees: _.random(3, 30),
  revenue: _.random(10000, 100000),
  industry: _.sample(industries)
}

And plotted it in visualize by breaking it down piece-by-piece:

  1. Start with a line chart
  2. Switch to Options tab of sidebar (since 4.1)
    • Uncheck "Show Connecting Lines"
    • Check "Scale Y-Axis to Data Bounds"
  3. Switch back to the Data tab
  4. Modify the "Y-Axis"
    • use the Average aggregation
    • on the employees field
  5. Add a "Dot Size" metric
    • use the Unique Count aggregation
    • on the company field
  6. Add a "Split Lines" bucket
    • use the Terms aggregation
    • on the industry field
    • I like to set the size close to the cardinality of my data
  7. Add an "X-Axis"
    • use the Histogram aggregation
    • on the revenue field
    • guess an interval, you will need to play with this a bit
  8. Finally, click Apply

This configuration is pretty complex, but the resulting visualization shows a lot of information.

scatter plot

share|improve this answer

I found a hack for this.

  1. Create a line chart
  2. X axis is a Terms aggregation of foo
  3. Add sub-aggregation (Split Lines) on the same field
  4. Y Axis is sum of your other column (bar)

I don't see any way of making the legend meaningful, though

share|improve this answer
    
Assuming that my X axis is "minrevenue" and my Y axis is "minemployees" (I'm looking for a correlation between revenue and # employees :) does this look right? i.stack.imgur.com/7UJdN.png – Matt Ball Jun 10 '15 at 21:03
    
Looks right to me. I'm eager to know if it worked. – Jim Davis Jun 10 '15 at 21:35
    
I'm not sure... the Y axis doesn't really look right to me, since it's a sum of # employees. Average looks a little better, but it's not great. It's certainly not a true scatterplot. – Matt Ball Jun 10 '15 at 21:39

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.