Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!
I am placing the header row from a CSV file into a pulldown button. I want to have the user selection ("ColumnValue") in the pulldown set the column to be plotted.
Hi t-rex22,
could you give a short example of your data in its original form including the headers and an example of what the output should look like, I am afraid I dont quite understand.
regards
Bernd
on menuPick pItemName
drawChart lineOffset (pItemName,the text of me)
end menuPick
If the list of names is the same order as the columns then this should work - you could always add an offset value if the first option was the fourth column, etc.
I have so far succeeded at filling the pulldown menu with the header row (row 1) but I have not yet figured out how to allow the user to pick one of the options (Velocity or ProbeAccel) and have "it" plotted against "Time".
The plotting routine (chartsengine) will plot whichever column I "hard" write into the line I showed in my first post.
on menuPick pItemName
-- assuming you have the header in the menu
-- assuming tFileData has no header, just the data
-- if time is in the menu you obviously would not want to plot time against time
-- you either take time out of the menu or you can catch this
-- if pItemName = "time" then exit menuPick -- unblock this line if you leave time in the menu
put lineOffset(pItemName,the text of me) into tLineNo
repeat for each line aLine in tFileData
put item 1 of aLine & comma & item tLineNo of aLine & return after tChartData -- with time in the menu
-- put item 1 of aLine & comma & item tLineNo + 1 of aLine & return after tChartData -- unblock this if you take time out of the menu
end repeat
delete last char of tChartData -- return
-- puts the data into the message box
put tChartData --into field "f2"
end menuPick
it is as sparkout suggested, you determine the line number which is the item number to look for.
In case you dont want time in the menu you have to add 1 to the line number (look at the comments in the code)
I hope I got you right.
regards
Bernd