Jump to content

Excel Chart 2 Y axis


ats

Recommended Posts

I am trying to create an excel line chart with 2 Y axis, one on either side and was wondering if someone has tried it before. I have multiple channels to display as lines. The 'Excel insert graph.vi' in the report generation toolkit does not have "lines on 2 axis" graph.

I was told one can work with ActiveX or Macro's to accomplish it. As I have lot of data, Macro's may create issues. Also I tried to play around with Excel Set Graph scale.vi and mess around with ActiveX properties but couldn't find a way to do it.

I am using LabVIEW 8.0 on Windows XP machine. I will appreciate any help or suggestions in this regard.

Thank you,

Atul

Link to comment

Hiya,

Firstly, I would like to warn you that interfacing with MS Office applications is not difficult, but it definitely ain't no cup of tea, either. :thumbdown:

Also, you may run into trouble when you upgrade to a new version of MS Office.

QUOTE(ats @ Feb 21 2007, 11:12 AM)

I was told one can work with ActiveX or Macro's to accomplish it.

Essentially, interfacing with MS Office through ActiveX allows you to run VBA code externally. What I found as a quick way to "see how things work" with VBA is to use the macro-record feature in Excel, and look at the generated code. That will give you an idea of how to programatically build a 2-axis graph.

The LV code will turn out to be a bunch of property nodes and methods which graphically mimic the VBA code (that's the way I think of it). LV 8 is great in that it allows you to look-up help for VBA properties and methods directly from the block diagram.

Alternatively, you can build the macro in Excel and simply "call" it from LV. I think this was covered in the available examples.

I hope that helps,

--H

Link to comment

I have built a simple "LVBA" application that opens excel, creates data, builds a chart and adds a second Axis.

It's a bit hurried, but I did take the time to annotate my code. :thumbup:

FYI, Atul, all VBA code written in LabVIEW ends up looking like that. I would normally break this sort of thing into a bunch of sub-vi's.

One thing I've done in the past was to build a template with the charts already properly formatted, etc., and simply add the data to spreadsheet. That worked out quite well, but took a great deal of time to tweak. I would suggest this sort of thing if you are using your code to generate a test data report.

I hope that helps

--H

Link to comment

Thanks, this is really helpful and also the ideas you gave.

Atul

QUOTE(Doon @ Feb 21 2007, 11:58 PM)

I have built a simple "LVBA" application that opens excel, creates data, builds a chart and adds a second Axis.

It's a bit hurried, but I did take the time to annotate my code. :thumbup:

FYI, Atul, all VBA code written in LabVIEW ends up looking like that. I would normally break this sort of thing into a bunch of sub-vi's.

One thing I've done in the past was to build a template with the charts already properly formatted, etc., and simply add the data to spreadsheet. That worked out quite well, but took a great deal of time to tweak. I would suggest this sort of thing if you are using your code to generate a test data report.

I hope that helps

--H

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.