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

Auto Multiple Line Chart Possible for Non Time Series? #102

Open
hc128168 opened this issue May 13, 2020 · 5 comments
Open

Auto Multiple Line Chart Possible for Non Time Series? #102

hc128168 opened this issue May 13, 2020 · 5 comments

Comments

@hc128168
Copy link

hc128168 commented May 13, 2020

Hi,

I wonder whether plotly panel can automatically create "trace"s based on the unique value of a column in the SQL result.

For example, let's say my SQL result is like this

x_axis|y_axis|trace

1 | 1 | trace1
2 | 2 | trace1
3 | 3 | trace1
4 | 4 | trace1
5 | 5 | trace1
0 | 1 | trace2
1 | 2 | trace2
2 | 3 | trace2
3 | 4 | trace2
4 | 5 | trace2

I want to have two lines in the graph.

Currently, I have to two queries configured -- one with "where trace = 'trace1'" and another "where trace = 'trace2'" to get those two lines displayed

This doesn't scale well as I add more unique "trace"s to the DB.

Grafana's come with "graph" plugin and it will take a column named "metric" as the "trace" to provide a multiline chart. Tho, it doesn't work for non time series, that's why I am trying plotly here.

Seems like there was a ticket for mutliline chart for time series:
#9

So maybe non-time-series multiline chart isn't supported?

Any pointer is appreciated.

@Bubbu17
Copy link

Bubbu17 commented May 25, 2020

This is similar to the feature request in #95

@Bubbu17
Copy link

Bubbu17 commented May 25, 2020

image something like this?

@hc128168
Copy link
Author

image something like this?

For time series, it is possible to get multiple line chart with Grafana's built-in plugin "Graph".

@mjerabek
Copy link

For non-time series, it is also possible to use Grafana's builtin Graph, encode the non-time measure into year component of date (has highest usable range), and display it as a time series. Then fix the date range for the dashboard. This is an extremely roundabout way of doing it, but so far the only one I have discovered - for cumulative histograms (with percentiles on the X axis) from PostgreSQL data source, with X axis from year 2000 to 2100, this works "well enough". 🤷‍♂️

@hc128168
Copy link
Author

hc128168 commented May 26, 2020

@mjerabek appreciate your suggestion -- yes, I noticed that workaround too. Tho, it is kind of sad to tweak the data to fit the frontend. And then when I change the frontend, I have to tweak the data again...

That's why I opened this ticket.

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

No branches or pull requests

3 participants