DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

How do we plot multiple waveforms on the x-axis as in excel using DIADEM?

Solved!
Go to solution

I want to plot a graph in diadem where we have single y-axis and multiple x-axis as below:

joshilpa_0-1636405099256.png

The table is as below:

 

Sorted Time Series Percentage of Population AVG of time series   2x AVG of time series 90% of Max Sample
5 0.5% 68   136 115.2
10 1.0% 68   136 115.2
14 1.5% 68   136 115.2
18 2.0% 68   136 115.2
18 2.5% 68   136 115.2
18 3.0% 68   136 115.2
18 3.5% 68   136 115.2
21 4.0% 68   136 115.2
21 4.5% 68   136 115.2
21 5.0% 68   136 115.2
21 5.5% 68   136 115.2
21 6.0% 68   136 115.2
21 6.5% 68   136 115.2

 

Attached a sample using excel, could you please help achieve the same on DIADEM

0 Kudos
Message 1 of 7
(2,664 Views)
Solution
Accepted by topic author ebenellis

Hi joshilpa,

 

You can display vertical lines like that with a "Constant" curve type, for which you only need one X value.  I created a DataPlugin with the Excel DataPlugin Wizard that reads the data columns from your *.xlsx file, then I created a script to populate the Group properties needed to show those vertical lines (and assign the "%" unit string).

 

You need to double-click the *.uri file first to register the DataPlugin, but then you can run the *.vbs in DIAdem SCRIPT to see the result.

Excel Graph in DIAdem.png

 

Brad Turpin

Principal Technical Support Engineer

NI

Message 2 of 7
(2,626 Views)

Hi Brad,

Thank you, this script worked!

Could you please help with 2 doubts below:
1. How can we add title to the graph from the script based on the file name loaded?

2. Could you please share the steps you have used to generate Excel Graph.TDR?

 

0 Kudos
Message 3 of 7
(2,611 Views)

Hi joshilpa,

 

I configured the layout manually with the mouse, dragging channels onto the graph, double-clicking the graph and configuring settings in its dialog and such, then saving the resulting layout as a TDR file.

 

You just need to drag the filename property onto the layout to show the currently loaded data file.  Here's an updated and saved TDR file that has that change, with no "name:' prefix and centered with enlarged text.

 

Brad

Message 4 of 7
(2,599 Views)

Hi Brad,

 

Thanks for the solution it works fine. Could you please let me know if I increase the description in legend is it possible to left align the text when exporting it as an image  (attached) ?
Script used to save the graph as an image:

def save_image(report_type):
file_name = dd.Data.Root.Properties("name").Value
dd.Report.Settings.ImageExport.JPG.BitsPerPixel = 3
dd.Report.Settings.ImageExport.JPG.Quality = 75
dd.Report.Settings.ImageExport.JPG.Progressive = 0
dd.Report.Settings.ImageExport.JPG.UseRatio = True
dd.Report.Settings.ImageExport.JPG.Height = 768
dd.Report.ActiveSheet.ExportToImage(image_save_path + "" + file_name + "_" + report_type + ".JPG",
dd.eImageExportTypeJPG)
print(dd.Data.Root.Properties("name").Value)

joshilpa_0-1637148766213.png

0 Kudos
Message 5 of 7
(2,568 Views)

Hi joshilpa,

 

What version of DIAdem are you using?  When I add the extra text to the legend of the graph, it automatically appears left justified...

Legend 90 Pct.png

 

Brad Turpin

Principal Technical Support Engineer

NI

0 Kudos
Message 6 of 7
(2,528 Views)

HI Brad,

 

When you export the graph as an image you will observe the formatting will no longer last.

I am using the below version:

joshilpa_0-1638891737367.png

 

0 Kudos
Message 7 of 7
(2,519 Views)