Question: Maplet Plot Problem

It took me a couple of days just to write the below Maplet code which loads a CSV file (time series organized in

columns where the first column is date/year etc and first row contain the names of the stocks)

and displays the stock names in a dropdownbox. Now I want to plot my selection from my dropdownbox

but now I have a new problem. When I include the "onchange = AC"

command in the drop1 command line in order to update my selection from the dropdownBox

I get an error message :

 

Error, (in Maplets:-Elements:-Maplet) reference AC used as the 'onchange' attribute of the DropDownBox element DD is missing
 

I am note sure what that is coming from and what I have done wrong


restart :
with(Statistics) :
with(plots) :
with(LinearAlgebra) :
with(Maplets) :
with(Maplets[Elements]) :
with(Maplets[Tools]):
with(ArrayTools) :

X := proc (x) global pap, mam, LL, LLL, Nr, Nc, g;

if not assigned(LL) then

pap := Maplet(FileDialog['FD1']('filefilter' = "csv", 'filterdescription' = "csv", 'onapprove' = Shutdown(['FD1'])));

mam := Display(pap)[1];

LL := ImportMatrix(mam, source = csv) :

Nr, Nc := Size(LL) :

LLL := Matrix(LL[2 .. Nr, 2 .. Nc]) :

Nr, Nc := ArrayTools:-Size(LLL) :

g[1] := ""

end if;


if assigned(LL) then

g[2] := 'Data-Loaded-OK';

g[3] := Set(('DD')(itemlist) = sort([seq(Row(LL, 1)[i], i = 2 .. Nc)], lexorder));

g[x]

end if :

end proc :


drop1 := DropDownBox[DD](["Time Series"], width = 200):    #  onchange=AC

tx1 := TextField[TF1](width = 15, background = green, editable = false) :

p1 := Plotter[P](width = 600) :

Action[AC](Evaluate(P = 'plot(x^2, x = 0 .. 10, color = red, thickness = 3)')):

x1 := Button['PP']("End Plot", onclick = Shutdown()) :

tool := "Select a CSV file with time series organized in columns where the first column \n contain the dates/years etc and the first row contains the names" :

Display(Maplet([[Button['Bu']("Select a csv file with data", tooltip = tool, onclick = Action(Evaluate('Bu' = 'X(1)'), Evaluate('TF1' = 'X(2)'), Evaluate('DD' = 'X(3)'))), tx1, drop1], [p1]])) ;

 

View 8342_plot stock.mw on MapleNet or Download 8342_plot stock.mw
View file details

Download 8342_Stock Index.csv
View file details

Please Wait...