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

I have several million documents in the ElasticSearch index with some number fields, like foo and bar . Is there a way to use Kibana 4 to create a graph with foo values โ€‹โ€‹along the X axis and bar values โ€‹โ€‹along the Y axis? Like a very, very simple chart that you can create using Excel.

I'm fine with some sort of sample / aggregation. I understand that these tools will not show me a plot with 20 million data points. I'm just trying to see if there is an obvious connection between foo and bar by creating a graph.

+6
source share
2 answers

To simply calculate the relationship between income and number of employees, I would simply use a line chart as follows:

simple line chart

To justify creating a scatter plot graph (since they are awesome and I wanted to), I created some fake data that looked something like this:

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

And he built it to visualize, breaking it in parts:

  • Start with a line chart.
  • Go to the Options tab of the sidebar (starting with version 4.1)
    • Uncheck Show Connect Lines
    • Check the "Y-axis scale to data borders" checkbox.
  • Return to the "Data" tab.
  • Change "Y-Axis"
    • use medium aggregation
    • in the employees field
  • Add Dot Size Metric
    • use aggregation Unique account
    • in company field
  • Add a Split Line Bucket
    • use aggregation Terms
    • in the industry field
    • I like to set the size close to the power of my data.
  • Add "X-Axis"
    • use aggregation histogram
    • in the revenue field
    • Guess the interval, you need to play a little with it
  • Finally click Apply

This configuration is rather complicated, but the resulting visualization shows a lot of information.

scatter plot

+2
source

I found a hack for this.

  • Create a line chart
  • The X axis is the aggregation of the terms foo
  • Add sub-aggregation (Split Lines) in the same field
  • Y axis is the sum of your other column (bar)

I see no way to make the legend significant, although

0
source

Source: https://habr.com/ru/post/984072/


All Articles