I need to display a line chart containing 2 different sets of data (series) that i receive from my epics nodes .
[The first data-set is 2 Arrays for Current Signal containing 197 elements - one array for x-co-ordinates and one for y co-ordinates
The second data-set is 2 Arrays for Golden Standard containing 30 elements - one for x co-ordinates and one for y co-ordinates]
Both datasets have values that fall within the same range on the X-axis chart
I have an issue when i plot this data to a line graph causing the chart to show incorrectly
I've illustrated the problem I'm having by writing some simple code to plot 2 data-sets (Array 1 - ten element, Array 2 - five elements) and hard-coding the info in the arrays into my code to simulate my problem - Looking at the graph and comparing the data we see that the chart is not rendering the lines correctly. Basically When the chart is plotted Array1 is plotted correctly but the Array2 Y-coordinates which has 5 elements are plotted on the first 5 X co-ordinates of Array1 graph no matter what the Array2 X co-ordinates are. I've tried various ways of fixing this issue but no joy.
Some of the fixes I've tried are are to pass the second data-set to another variable n, and then plotting both series on the same graph by a return {payload:[m,n]}; but also no luck.
I need to be able to plot this data correctly. Any help would be appreciated
Also if any one has any ideas on how to only enlarge one set of pts for a particular line in a line chart instead of all the lines in the chart like the option the line chart gives you your answer would be appreciated. The example code is provided below
[{"id":"81b58820.dd8428","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"f3d4b953.e2b008","type":"function","z":"81b58820.dd8428","name":"Normalize&MergeXY-Array","func":"context.X = context.X || 0.00; \ncontext.X = [0,10,20,30,40,50,60,70,80,90] //Array 1 X-CoOrdinates\n\ncontext.Y = context.Y || 0.00; \ncontext.Y = [5,15.5,12.5,23,17,99,45,11,27,5] //Array 1 Y-CoOrdinates\n\ncontext.GX = context.GX || 0.00; \ncontext.GX = [0,15,35,55,90] //Array 2 X-CoOrdinates\n\ncontext.GY = context.GY || 0.00; \ncontext.GY = [2,45,10,30,89] //Array 2 Y-CoOrdinates\n\n\n\n\nvar m={};\nm.labels = context.X,context.GX;\nm.series = ['Current Signal','Golden Standard'];\nm.data = [\n context.Y,\n context.GY,\n ];\n\nreturn {payload:[m]};\n\n","outputs":1,"noerr":0,"x":440,"y":300,"wires":[["d3cd2613.1882f","1ec950b6.a3e73f"]]},{"id":"d3cd2613.1882f","type":"ui_chart","z":"81b58820.dd8428","name":"","group":"34e8b5e8.fdddc2","order":2,"width":20,"height":7,"label":"Normalized","chartType":"line","legend":"true","xformat":"Energy","interpolate":"linear","nodata":"NO DATA","dot":true,"ymin":"-5","ymax":"105","removeOlder":"1100","removeOlderPoints":"10500","removeOlderUnit":"1","cutout":0,"useOneColor":true,"colors":["#2ca02c","#f97a2c","#5ce0cc","#2c3aa0","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":false,"outputs":1,"x":710,"y":320,"wires":[[]]},{"id":"1ec950b6.a3e73f","type":"debug","z":"81b58820.dd8428","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":710,"y":280,"wires":[]},{"id":"c1716b5b.e13338","type":"inject","z":"81b58820.dd8428","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":200,"y":300,"wires":[["f3d4b953.e2b008"]]},{"id":"34e8b5e8.fdddc2","type":"ui_group","z":"","name":"Chart","tab":"f3f2f651.2f6dd","order":1,"disp":false,"width":"26","collapse":false},{"id":"f3f2f651.2f6dd","type":"ui_tab","z":"","name":"Question - How to display 2 different dimension arrays on Line Chart correctly","icon":"dashboard","disabled":false,"hidden":false}]
question.json (2.1 KB)