Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add bar chart plotting and creating traces from data #81

Open
wants to merge 20 commits into
base: master
Choose a base branch
from

Conversation

banburybill
Copy link

I've been looking for an easy way to draw bar charts in Grafana. Since Plotly can do bar charts, I figured adding bar charts to the chart types supported by your rather handy plugin might be good way ahead.

In the process I also ran into a requirement for bar charts where the number of traces depended on the data (e.g. charting the number of each different type of QTYPE in a set of DNS data). So I've also added what I've called 'autotrace' mode. For this, the input data must be 3 columns, respectively trace name, X, Y. A trace is created for each distinct trace name.

Jim Hague added 15 commits October 2, 2019 10:09
…r stacked.

More remains to be done, but this gets us started.
Set the bar marker config to a separate config object. When preparing a trace, make sure we just use trace items appropriate to the graph type.

This fixes config confusion where scatter config was leaking into bars meaning, for example, that one had to set the scatter colour to solid to get the bar drawing and avoid errors due to a lookup being done on the value for the ramp colour that is the scatter default.
I guess we really should be somehow measuring the x and y tick label size and using that in the calculation. For now, though...
When autotrace is selected, input must be 3 columns in table mode, each containing trace name, x and y. Automatically generate a trace for each distinct trace name.
For autotrace, this is the order in which traces are created from the data, which in turn is the order in the data.
For manual traces, this is the order of the traces.
…t or lasso.

You will most end up treating non-time data as timestamps, with hilarious results.
@ryantxu
Copy link
Contributor

ryantxu commented Oct 21, 2019

This looks good -- I will try to give it some attention this week

@amychod
Copy link

amychod commented Nov 15, 2019

Tried it out, looks great. Will it be pulled into the master?

@banburybill
Copy link
Author

Any thoughts on this PR?

We're close to using it in production here. We did have issues with Plotly panels showing red triangle warnings, but updating to Grafana 6.5.2 and the recent renderingCompleted() fix has made all those go away.

@amotl amotl mentioned this pull request Feb 11, 2020
@jcerrada
Copy link

Hi! Any update on this PR, I'd be awesome to have it.

@mariush2
Copy link

Hi! Any chance of this getting implemented any time soon? Just started using Plotly and really miss having this feature to create bar charts with table data.

@matawed
Copy link

matawed commented Jul 10, 2020

Tried to package this PR by following https://github.com/NatelEnergy/grafana-plotly-panel#building and https://github.com/NatelEnergy/grafana-plotly-panel#releasing on my fork.
I would like to check the panel on my local Grafana test setup, but I failed. Package can be found on https://github.com/matawed/grafana-plotly-panel/releases/tag/v0.0.13

Registering the plugin works in Grafana, but if I like to create a new Plotly panel, then Grafana reports

"Dashboard init failed
t.onAppEvent is not a function`

Used Grafana version v6.5.1 (1763a0f)

Anybody with the same issue?

@xkilian
Copy link

xkilian commented May 27, 2021

The plugin is broken in newer versions of Grafana. I think @ryantxu has dropped support for it pretty much. Maybe, transferring maintainership of the plugin to someone else might be a good idea so that the plugin can be modernized (dataframes, compatibility, new features, etc.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
7 participants