Git Product home page Git Product logo

sunburst-grafana-plugin's Introduction

Grafana Sunburst Plugin

This plugin plots sunburst chart with the data required passsed into it.

What is Sunburst Chart?

Sunburst chart is a multi-level Pie Chart, and Radial Treemap โ€” is typically used to visualize hierarchical data structures. A Sunburst Chart consists of an inner circle surrounded by rings of deeper hierarchy levels.

How to structure/format data for sunburst graphs?

Understanding on how to the structure data is of the most difficult part while plotting any kind of graphs. We will now see how to import the data into the influxdb to plot a sunburst graph. Here's a example, which we will further understand:

  {
    "id": "0.0",
    "parent": "",
    "name": "The World",
    "count": 7542011839
  },
  {
    "id": "1.3",
    "parent": "0.0",
    "name": "Asia",
    "count": 4503248822
  },
  {
    "id": "1.1",
    "parent": "0.0",
    "name": "Africa",
    "count": 1256268025
  },
  {
    "id": "1.2",
    "parent": "0.0",
    "name": "America",
    "count": 1006801064
  },
  {
    "id": "1.4",
    "parent": "0.0",
    "name": "Europe",
    "count": 743253404
  }
]

The first id, in this case i.e '0.0' be the parent or center of the graph, having some count(value) and some other parameters in form of name , parent etc.

{
  "id": "0.0",
  "parent": "",
  "name": "The World",
  "count": 7542011839
}

Note: The center or the parent won't have any parent linked to it, hence has a empty value in it

Now, lets move to its children, which are items having names with Asia, Africa, Europe, America having similar structure as the first one, but with parent = '0.0' which is ideally the id of the parent. So yes, that's the way we link the children with the parent. And you may further link the level-2 children with level-1 and go on... Here's the reference of the sunburst chart

Sunburst chart

Now, lets see how to query the data on Grafana dashboard after importing the above data into the database

So the above chart can be used using any format in-order to plot (time series or table), so just add a panel. Select the sunburst graph and add the query. Something like: Select * from <Measurement>

And here's the view of the sunburst chart with the above data:

World population chart, for more reference the data needs to be in the below format: Static Sample Data

And there you go, having your data to be plotted in sunburst style. We have used fusion charts to plot the sunburst graph you may further change the style depending on the need or requirement for more reference, refer to theFusion charts.

Play around with the plugin

  1. Install dependencies
yarn install
  1. Build plugin in development mode or run in watch mode
yarn dev

or

yarn watch
  1. Build plugin in production mode
yarn build

Thanks for reading!!

Learn more

sunburst-grafana-plugin's People

Contributors

dikshita25 avatar mountainfirefly avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

barionleg

sunburst-grafana-plugin's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.