ats Posted February 22, 2007 Report Share Posted February 22, 2007 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 Quote Link to comment
Doon Posted February 22, 2007 Report Share Posted February 22, 2007 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 Quote Link to comment
Doon Posted February 22, 2007 Report Share Posted February 22, 2007 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 Quote Link to comment
ats Posted February 23, 2007 Author Report Share Posted February 23, 2007 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 Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.