Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to create an XY (aka scatter) plot using Kibana 4?

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.

like image 298
Matt Ball Avatar asked Mar 21 '15 00:03

Matt Ball


People also ask

How do you plot a graph in Kibana?

Area Graph Go to visualization and choose area with index as countriesdata. We need to select the Y-axis and X-axis. We will plot area graph for max area for country wise.

What is an XY scatter?

A Scatter (XY) Plot has points that show the relationship between two sets of data. In this example, each dot shows one person's weight versus their height. (The data is plotted on the graph as "Cartesian (x,y) Coordinates")


1 Answers

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

like image 105
Spencer Alger Avatar answered Nov 21 '22 13:11

Spencer Alger