From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Easiest way to replicate these common Excel graphs

Solved!
Go to solution

So my most common used graph in Excel is the 2d chart with table.  I am trying to set up a report that will display a number of these.  Depending on the data loaded, there will be different numbers of data pairs, sometimes 10, sometimes 13, sometimes 17, etc.

 

I've tried now for a few hours to replicate this simple chart.  I'm not sure if I have to have 2 objects, one a table and one a graph, or if it can be done in one step.  I've tried simple labeling of the points, but because DIAdem treats the points as a 2d plot and not a simple set of bars, the labels for each set are difficult to arrange.  If I align one set of labels with "left" and one with "right" they almost work.

 

How can I most easily replicate my very readable chart from Excel, and still take into account that the number of points will change often, and that I don't want to go through 30ish graphs to reconfigure each one individually each time this happens?

I can work around assigning the plots to specific data groups and making sure those groups have common names on the variables such that this portion will always be the same, that is no problem.

 

 

Download All
0 Kudos
Message 1 of 4
(2,587 Views)

OK I figured out how to make my backup, no table version work by using the offset feature and a combination of top right and top left for text alignment.  This is attached.  But I'd still like the table and plot in one option that I strongly prefer.

0 Kudos
Message 2 of 4
(2,572 Views)
Solution
Accepted by jheadley

Hi jheadley,

 

Yes, you need to define 2 objects – a 2D axis system and a 2D table. The table is without headline table alignment is horizontal and the size is aligned with the size of the 2D axis system.

The X scaling of the 2D axis system is set to: scaling type is linear, mode is “Range and ticks manual”, range is identical with the length of the X channel and the Tick channel is the X channel.

 

Please have a look at the attached example.

 

The only thing you need to update in case the channel length changes is the range for the X axis. You can do this manually of via script.

Dim o2DAxisX, sChnRef
Set o2DAxisX = Report.ActiveSheet.Objects.Item("2DAxis1").XAxis
sChnRef = o2DAxisX.Scaling.Tick.Channel.Reference
o2DAxisX.Scaling.SpanWidth = Data.GetChannel(sChnRef).Size

Greetings

Walter

Message 3 of 4
(2,528 Views)

That's exactly what I was after, thank you!

0 Kudos
Message 4 of 4
(2,512 Views)