Plot Array of numbers into Line chart

  • What Grafana version and what operating system are you using? 11

  • What are you trying to achieve? Plot a plain array of numbers representing a curve

  • How are you trying to achieve it? Using different dashboards and plugins

  • What happened? Not able to do it

  • What did you expect to happen? Plot the array of numbers with a line

I have the following query:

SELECT last("value") AS "angle" FROM "Tool1.StepTraceContent[0].Values"

Returning the following result:

[0 0.000125641681 0.000628208405 0.001884625215 0.003894892111 0.006533367412000001 0.009800051118000001 0.013694943229 0.018092402064 0.023118069304 0.028771944948999997 0.034928387318 0.041838679773 0.049502822314 0.057543889897999995 0.065836240844 0.07412859179 0.08242094273600001 0.09046201032 0.098377436223 0.10629286212599999 0.114208288029 0.122249355613 0.130290423197 0.138331490781 0.14637255836500002 0.15453926763 0.162831618576 0.17087268616 0.178788112063 0.186829179647 0.19474460555 0.20278567313399998 0.210826740718 0.21874216662100002 0.226783234205 0.23494994347000003 0.242991011054 0.25103207863800003 0.259073146222 0.26711421380600003 0.275280923071 0.283447632336 0.29148869992 0.299655409185 0.307947760131 0.316240111077 0.32428117866100004 0.332322246245 0.340363313829 0.348404381413 0.35631980731600005 0.3643608749 0.372401942484 0.380443010068 0.38860971933300004 0.39665078691700006 0.404691854501 0.412607280404 0.420522706307 0.42856377389100003 0.436479199794 0.44439462569700006 0.45243569328100003 0.460602402546 0.46889475349200005 0.4769358210760001 0.48497688866 0.493143597925 0.50131030719 0.509477016455 0.517518084039 0.525559151623 0.533725860888 0.541892570153 0.550059279418 0.557974705321 0.565890131224 0.573931198808 0.582097908073 0.590138975657 0.598180043241 0.606221110825 0.61438782009 0.622554529355 0.630595596939 0.638511022842 0.646552090426 0.654467516329 0.662508583913 0.6705496514970001 0.678590719081 0.686883070027 0.695175420973 0.703467771919 0.711508839503 0.7195499070870001 0.727716616352 0.735757683936 0.7437987515200001 0.7518398191040001 0.7598808866880001 0.7681732376339999 0.7763399468990001 0.7843810144830001 0.792296440386 0.8002118662890001 0.808252933873 0.816168359776 0.824083785679 0.832124853263 0.8402915625280001 0.848458271793 0.856624981058 0.8645404069610001 0.8725814745450001 0.8806225421289999 0.888663609713 0.896579035616 0.9046201032000001 0.912786812465 0.92095352173 0.9291202309950001 0.9371612985790001 0.945202366163 0.9532434337469999 0.961284501331 0.969325568915 0.9772409948180001 0.985407704083 0.993574413348 1.001866764294 1.0099078318780002 1.017948899462 1.025989967046 1.0340310346300001 1.042072102214 1.0499875281170001 1.058028595701 1.066195304966 1.074362014231 1.0825287234960002 1.090444149399 1.0983595753020001 1.106400642886 1.11444171047 1.122482778054 1.130523845638 1.1386905549030002 1.146982905849 1.155275256795 1.16344196606 1.171483033644 1.179524101228 1.1875651688120001 1.195606236396 1.203521662299 1.211562729883 1.219729439148 1.227896148413 1.236062857678 1.243978283581 1.251893709484 1.259934777068 1.2678502029710002 1.275891270555 1.283932338139 1.291973405723 1.3002657566690001 1.308432465934 1.316473533518 1.324514601102 1.332555668686 1.34059673627 1.348763445535 1.356804513119 1.364845580703 1.373012289968 1.381304640914 1.389345708498 1.397386776082 1.405302201985 1.413343269569 1.421384337153 1.429425404737 1.4373408306400002 1.445381898224 1.453548607489 1.461715316754 1.4697563843380002 1.477671810241 1.485712877825 1.493628303728 1.501669371312 1.5095847972150003 1.517625864799 1.525792574064 1.5339592833290001 1.5421259925939999 1.550167060178 1.558208127762 1.566249195346 1.574415904611 1.582331330514 1.590372398098 1.5985391073630002 1.606705816628 1.6148725258930001 1.622787951796 1.63082901938 1.638870086964 1.646911154548 1.6550778638130001 1.663118931397 1.6711599989810002 1.679452349927 1.6876190591920002 1.695660126776 1.7035755526790002 1.711616620263 1.719657687847 1.7275731137500001 1.735614181334 1.7436552489180002 1.7518219581830001 1.759988667448 1.768281018394 1.7763220859780002 1.7843631535620001 1.7924042211459998 1.80044528873 1.808486356314 1.816527423898 1.824568491482 1.8327352007470001 1.841027551693 1.849068619277 1.857109686861 1.8651507544450001 1.873191822029 1.881232889613 1.889273957197 1.8971893831 1.9053560923650001 1.9135228016300003 1.921563869214 1.9294792951170001 1.9375203627010003 1.9455614302850002 1.95372813955 1.961769207134 1.969810274718 1.9779769839830001 1.986269334929 1.9944360441940001 2.002477111778 2.010392537681 2.0183079635839998 2.026349031168 2.034264457071 2.042305524655 2.0502209505580002 2.058387659823 2.066554369088 2.0747210783530003 2.082636504256 2.09067757184 2.0987186394240003 2.106634065327 2.114675132911 2.122590558814 2.1307572680790003 2.138923977344 2.1470906866090003 2.155131754193 2.163172821777 2.17108824768 2.179129315264 2.187170382848 2.195085808751 2.203126876335 2.2112935856 2.219585936546 2.227752645811 2.235668071714 2.243709139298 2.251875848563 2.259916916147 2.267957983731 2.2758734096340003 2.284040118899 2.2923324698450003 2.30049917911 2.308540246694 2.3165813142780003 2.3246223818620004 2.332663449446 2.34070451703 2.348745584614 2.356786652198 2.3648277197820002 2.373120070728 2.381161138312 2.3892022058960003 2.3971176317990004 2.405284341064 2.4131997669670002 2.4212408345510004 2.429281902135 2.4375742530810003 2.445740962346 2.4540333132920003 2.461948739195 2.469864165098 2.477905232682 2.485946300266 2.49398736785 2.502028435434 2.5101951446990003 2.518361853964 2.526528563229 2.534695272494 2.542736340078 2.550651765981 2.5586928335650003 2.566733901149 2.574774968733 2.5828160363170003 2.590982745582 2.599149454847 2.607316164112 2.615357231696 2.6233982992800002 2.6314393668640004 2.639480434448 2.6475215020319998 2.6554369279350003 2.6636036372 2.671644704784 2.6799370557300004 2.687978123314 2.6960191908980002 2.7040602584820004 2.712101326066 2.7201423936499998 2.728183461234 2.736224528818 2.7443912380830002 2.7525579473480004 2.760724656613 2.7686400825160002 2.7766811501 2.784722217684 2.7927632852679998 2.8006787111710003 2.8087197787550005 2.816760846339 2.825053197285 2.83321990655 2.841135332453 2.8491764000370003 2.857217467621 2.865258535205 2.873299602789 2.881340670373 2.889381737957 2.897548447222 2.905840798168 2.9140075074330003 2.9220485750170004 2.9299640009200005 2.9380050685040002 2.9460461360880004 2.9539615619910005 2.962002629575 2.9700436971590003 2.9782104064239996 2.9863771156889998 2.994418183273 3.002459250857 3.0105003184409997 3.018541386025 3.026582453609 3.034497879512 3.042664588777 3.050831298042 3.0591236489880003 3.067290358253 3.0753314258369997 3.083372493421 3.091413561005 3.0994546285889997 3.107495696173 3.115536763757 3.123577831341 3.1318701822870003 3.140036891552 3.148077959136 3.1559933850390003 3.164034452623 3.171949878526 3.179865304429 3.187780730332 3.195696156235 3.203737223819 3.2120295747650003 3.220070642349 3.227986068252 3.236027135836 3.24406820342 3.252109271004 3.260150338588 3.2681914061720003 3.276358115437 3.284650466383 3.292817175648 3.300858243232 3.308899310816 3.3169403784 3.325107087665 3.3331481552490003 3.341063581152 3.349230290417 3.3573969996820003 3.3655637089470005 3.373604776531 3.3815202024340003 3.3895612700180004 3.397602337602 3.4056434051860003 3.4136844727700004 3.4215998986730005 3.4297666079380003 3.437933317203 3.446100026468 3.454266735733 3.462307803317 3.470348870901 3.4783899384850003 3.486431006069 3.494472073653 3.5026387829180003 3.5108054921830005 3.518972201448 3.527013269032 3.5349286949349996 3.5429697625189998 3.551010830103 3.559051897687 3.5669673235900006 3.575008391174 3.583175100439 3.591341809704 3.599382877288 3.607298303191 3.615213729094 3.6231291549969997 3.631170222581 3.639211290165 3.6471267160680005 3.655293425333 3.663585776279 3.6718781272250003 3.6800448364900005 3.6880859040740006 3.6961269716580003 3.704168039242 3.7122091068259997 3.72025017441 3.728291241994 3.736457951259 3.744624660524 3.752791369789 3.760706795692 3.7686222215950003 3.776663289179 3.784704356763 3.792619782666 3.800535208569 3.808576276153 3.816742985418 3.8249096946830003 3.832950762267 3.84086618817 3.8489072557540003 3.856822681657 3.864863749241 3.872904816825 3.8809458844090003 3.889112593674 3.897530586301 3.905697295566 3.91373836315 3.921779430734 3.929946139999 3.9379872075830002 3.945902633486 3.953818059389 3.961984768654 3.9701514779190004 3.9783181871840005 3.9863592547680002 3.9944003223520004 4.002441389936 4.01048245752 4.018397883423001 4.026313309326 4.034480018591 4.042646727856001 4.050059587035 4.055964746042 4.059859638153 4.062121188411 4.062749396816 4.062749396816 4.062749396816 4.062749396816 4.062623755135 4.062623755135 4.062623755135 4.062623755135 4.062623755135 4.062623755135 4.062623755135 4.062623755135 4.062623755135 4.062623755135 4.062623755135 4.062623755135 4.062623755135 4.062623755135 4.062623755135 4.062623755135 4.062623755135 4.062623755135 4.062623755135 4.062623755135 4.062623755135]
  • How could I plot the points in a line chart without having a value for X axis? Just using an auto separation?

  • If I have a variable indicating the frequency, would it be possible to create the X axis starting with the timestamp of the entry of the array?

SELECT last("value") AS "frequency" FROM "Tool1.StepTraceContent[0].Frequency"
  • I have tried business charts without success, always error “Cannot read properties of undefined (reading ‘Values’)”
  • I have tried PlotXY chart, without success.
  • I have read several pages and forums but not clear answer or explanation.

I would really appreciate just to have some brightness.

Regards

Hi, might be a long (not tested) shot, but have you tried using a Add field from calculation transformation, using Row Index (or something like that I don’t remember now), then you have a table with two columns - your value (Y axis) and increasing index (X axis). You can probably use XY / Trend chart with that data to plot it the way you want (I don’t know if there’s an option to hide X axis though).