Non-time x axis line graph

I am looking for a way to create a line graph where my x axis is a discrete set of sequential values and my y axis is some metric. Suppose I have the following SQL query to pull Jenkins build numbers, the amount of time the build took, and the time the build ended:

SELECT
  jj_name as job,
  jb_number as metric,
  TIME_TO_SEC(timediff(jb_end_time, jb_start_time)) as value,
  unix_timestamp(jb_end_time) as time_sec
from jenkins_job join jenkins_build on jj_id = jb_jj_id;

Sample mock data:

Job    Build  Time    End Date
Job1    578    234    9/28/2017 14:56
Job1    577    222    9/28/2017 14:52
Job1    576    219    9/28/2017 14:47
Job1    575    460    9/28/2017 14:41
Job1    574    229    9/28/2017 14:28
Job1    573    240    9/28/2017 14:01
Job1    572    246    9/28/2017 13:08
Job1    571    246    9/28/2017 12:22
Job1    570    249    9/28/2017 11:31
Job1    569    220    9/28/2017 11:17
Job2    578    234    9/28/2017 14:56
Job2    577    222    9/28/2017 14:52
Job2    576    1219   9/28/2017 14:47
Job2    575    1220   9/28/2017 14:41
Job2    574    229    9/28/2017 14:28
Job2    573    540    9/28/2017 14:01
Job2    572    646    9/28/2017 13:08
Job2    571    746    9/28/2017 12:22
Job2    570    349    9/28/2017 11:31
Job2    569    420    9/28/2017 11:17

Now I can “cheat” by changing the x axis to series to make each build number appear to be a separate series:
image

The problem is I want to be able to have multiple builds specified on the same graph as a line graph (assume for now they have correlated build numbers i.e. always run together). Each series would be a separate job. In excel it would look something like this:

image

Is something like this possible? It does not appear so. Basically I want to still use a line graph while having my x axis be something other than time.

1 Like

Hi,

Using the build-in graph panel I’m afraid the answer is no. Maybe there are some other graph panel plugin out there which may help you accomplish this.

Marcus

Hi,
Have you found way to make it? I also want make such kind of diagram.

2 Likes

Hi there !

Same problem here :confused: Trying to display my graph and put Gitlab builds for the X axis. Using prometheus as data source.

Have you guys find a way to do it ?

1 Like

Hi,

Same problem for us with PostgreSQL, did you find a plugin for this ?

you can use the following plugin

Any solution here? I met the same issue.

1 Like

Do you find solution for this issue? I want to make the build number as X axis as well.

1 Like

Actually I finally figured out, see my posting pic:

Did anyone find a solution?
Ploty is not supported in version 7…