[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

graph orientation in Excel

Li Chen

11/11/2006 2:20:00 PM

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();


--
Posted via http://www.ruby-....

2 Answers

David Vallner

11/11/2006 2:35:00 PM

0

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 Vallner

Li Chen

11/12/2006 2:52:00 AM

0

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

Thanks and I get it.

Li


--
Posted via http://www.ruby-....