How to add series to an excel chart through lua

Posted by Ptar on Sat 27 Jul 2013 04:25 AM — 6 posts, 21,410 views.

#0
I've output several pairs of columns to excel with x and y data that I want to present as a single chart in excel. I've found examples of how to make a chart of single series of data using range, but not how to add multiple series. I'm looking to do something like:

local excel = luacom.CreateObject("Excel.Application")
local chart = excel.Charts:Add()
chart:AddSeries("=SERIES(Sheet1!$A$1,Sheet1!$A$2:$A$10,Sheet1!$B$2:$B$10,1)")
chart:AddSeries("=SERIES(Sheet1!$C$1,Sheet1!$C$2:$C$10,Sheet1!$D$2:$D$10,2)")
chart:AddSeries("=SERIES(Sheet1!$E$1,Sheet1!$E$2:$E$10,Sheet1!$F$2:$F$10,3)")

Anyone know how to do this?
Amended on Sat 27 Jul 2013 04:36 AM by Ptar
#1
.
Amended on Sat 27 Jul 2013 04:38 AM by Ptar
USA Global Moderator #2
What does this have to do with MUSHclient?
#3
Isn't this the lua scripting section of the forum?
USA Global Moderator #4
Sure, but this is pretty specifically a MUD experience scripting forum. Are you even using MUSHclient for this?
Australia Forum Administrator #5
There's a Lua mailing list, if this is nothing to do with MUD games.

http://www.lua.org/lua-l.html