LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Having trouble formatting excel chart using Chart Wizard command.

Problem Description :

Trying to create an excel chart derived from an excel spreadsheet. Having trouble understanding the parameters to format in the Chart Wizard function to get the desired results. There are no error messages, just chart is not what expected.

Goal:

Chart with temperature on the left, y-axis. 3 lines on the graph for min meas temp, avg meas temp, max meas temp.

Bottom x-axis should contain year/month values.

 

Chart Wizard command:

status = ExcelRpt_ChartWizard (chart_temperature_handle, chart_data_worksheet_handle, D1:G3, ExRConst_GalleryLine, ExRConst_Rows, 0, 0, 0, 1, "Temperature Stats", "Year/Month", "Temp F", NULL)

NI Software : LabWindows/CVI version 8.0.1

NI Hardware : None device

Driver Version :

OS : Windows XP

Customer Information :

Mary Claflin

Technology Kitchen Corporation

US

maryclaflin@technologykitchen.com

Ph: (512) 965-4722

0 Kudos
Message 1 of 11
(5,669 Views)
Hi Mary,

I have received the emails you sent to support@ni.com and I am currently working on your issue. I will let you know as I progress as well as post to the forum so the community can benefit.

Thanks for your patience Mary.
Dan Weiland
0 Kudos
Message 2 of 11
(5,639 Views)
Hi Mary,

Looking at the Chart Wizard within Excel, it appears as though the only chart type that allows us to give a series of values for our XAxis would be the XY Scatter plot. There IS an option for this when using the CVI Excel Report function calls (specifying ExRConst_GalleryXYScatter for the plot type).

However, it appears that there are not any Excel report chart functions available in CVI to specify anything other than the general "series" object. When this object is sent through as a variant data type to Excel, Excel appears to automatically convert this single object into separate data series. This is because Excel is not immediately aware that we are attempting to use a Scatter plot, and thus must convert each column into a separate series. There is no object defined in the Excel report that would be able to handle the "Xseries" and "Yseries" option that are seen in the chart creation wizard within Excel. Thus, we have no way of specifying a different set of data for our XAxis.

It appears as though, at least for our own CVI functions, that there is no way to accomplish your goal. Since CVI is based around C - we CAN call any ActiveX client registered on the system. Because of this, we should be able to talk with Excel directly without the help of the CVI Excel Report functions, although this may be more difficult.

I haven't been able to find any specific C example code, but here is the Excel Object Model on which calls to Excel will most likely be based:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dv_wrcore/html/wrconexcelobjectmodeloverview.asp

Sorry for the inconvenience Mary.
Dan Weiland
0 Kudos
Message 3 of 11
(5,564 Views)

Hi,

I'm currently doing something similar, is this issue changed?

I have one collumm for the YY values and another collumm for the XX values and I can't place them correctly.

 

I'm using LabWindowsCVI 9.0.

Have you any hints on how to do it with MS Excel Object Library?

 

I apreciate any help.

Regards,

 

Daniel Coelho

 

Daniel Coelho
VISToolkit - http://www.vistoolkit.com - Your Real Virtual Instrument Solution
Controlar - Electronica Industrial e Sistemas, Lda
0 Kudos
Message 4 of 11
(5,059 Views)

Daniel,

 

I'm not quite sure I understand your problem. First of all what do you mean by XX and YY. Is that different than X and Y? Second, what do you mean by "I can't place them correctly."? What is happening when you try to place them? How are you trying to do it currently?

 

Here's a link to a white paper that goes over generating Excel reports with LabWindows/CVI. This may be very helpful in getting started.

http://zone.ni.com/devzone/cda/tut/p/id/5835

 

Regards,

 

Steven Zittrower

Applications Engineer

National Instruments

http://www.ni.com/support

Message 5 of 11
(5,034 Views)

I'm sorry, I mean X and Y 😉

The thing was that I wasn't able to create a chart with simply two colums, one with values and another with date/time string.

The graphic apeared funny because the date/time string was interpreted as another series of values, and I wanted the date/time on the horizontal axis (x).

I managed to do it by putting the horizontal values on the first colum (x) and the actual values (y) on the second colum and them I used the LabWindows function ChartWizard with one of the parameters using 'colums' instead of 'lines'...

Now it works as I wanted, the date/time string apears as the values for the horizontal axis (X) instead of another series of values.

Sorry if it was a bit messy.

Anyway, it is working now.

Thank you for your time.

Regards,

Daniel Coelho

 

Daniel Coelho
VISToolkit - http://www.vistoolkit.com - Your Real Virtual Instrument Solution
Controlar - Electronica Industrial e Sistemas, Lda
0 Kudos
Message 6 of 11
(4,991 Views)

Hi Daniel,

 

When you said " managed to do it by putting the horizontal values on the first colum (x) and the actual values (y) on the second colum and them I used the LabWindows function ChartWizard with one of the parameters using 'colums' instead of 'lines'..."

 

Which parameter were you refering to?

 

Regards,

 

Wilfred

0 Kudos
Message 7 of 11
(4,095 Views)

Since Daniel's post is from 5 years ago, I'm not sure if we can expect a response from him. Are you also trying to put a date/time string on the X-axis of an Excel Chart using the ChartWizard? Are you getting the same behavior he described, where the date/time string becomes a "series of values"?

Taylor B.
National Instruments
0 Kudos
Message 8 of 11
(4,077 Views)

I'm sorry for the delay.

I missed this email...

 

Looking 5 years in the past I found this:

 

Status = ExcelRpt_ChartWizard (ChartHandle, WorksheetHandle, chrCell, ExRConst_GalleryLine, 0, 2, 1, 0, 0, "", "Date and Time", "ºC", NULL);

 

I meant that the Chart Galery parameter was ExRConst_GalleryLine instead of ExRConst_GalleryColumn.

 

My log file had two text columns with these values:

 

"4.917","2007-12-27 10:48"
"4.817","2007-12-27 10:49"
"4.717","2007-12-27 10:50"

 

Using these values and the ChartWizard I got the chart I wanted.

 

Hope it helps.

Regards.

 

Daniel

Message 9 of 11
(4,064 Views)

Thanks for the reply, Daniel! Hopefully this can help out WilfredCho.

Taylor B.
National Instruments
0 Kudos
Message 10 of 11
(4,058 Views)