Graph orientation in Excel

Hi guys,

I copy one script as follows to draw a graph. The result is a
column-based serial, which means I get two lines composed of 3-2-1 and
10-6-3. My question is how I tell the script so that I get row-based
serial(3 lines), which are 3-10,2-6 and 1-3. Aslo how do find these
methods by querying Ruby. I try ri WIN32OLE but don’t get much
information.

Thanks,

Li

############excel.rb
require ‘win32ole’

excel = WIN32OLE.new(“excel.application”)

excel[‘Visible’] = TRUE;
workbook = excel.Workbooks.Add();
excel.Range(“a1:b1”).Value= [3,10]
excel.Range(“a2:b2”).Value= [2,6]
excel.Range(“a3:b3”).Value = [1,3]

ChartTypeVal=4
excel.Range(“a1:b3”).Select();
excelchart = workbook.Charts.Add();
excelchart[‘Type’] = ChartTypeVal;

savefile=‘C:\Ruby\self\excel1.xls’;
excelchart.Saved(savefile);

excel.ActiveWorkbook.Close(0);
excel.Quit();

Li Chen wrote:

Hi guys,

I copy one script as follows to draw a graph. The result is a
column-based serial, which means I get two lines composed of 3-2-1 and
10-6-3. My question is how I tell the script so that I get row-based
serial(3 lines), which are 3-10,2-6 and 1-3. Aslo how do find these
methods by querying Ruby. I try ri WIN32OLE but don’t get much
information.

Read the Excel documentation? Win32Ole is just an interface to its COM
API that lets you access those functions.

David V.

David V. wrote:

Read the Excel documentation? Win32Ole is just an interface to its COM
API that lets you access those functions.

David V.

Thanks and I get it.

Li