I recently posted about this but was unclear so posting again for clarity. I want to use XOJOs native Desktop Chart tools to plot data. I have two lists, one of time values, and one of values of f(t). I want to plot points of the form (t,f(t)). Here is the code I have so far, which is not working at all, and I know will not work. I am not sure how to make each f(t) value correspond to a time value in XOJO.
Var GraphData() As Double
Var TimeData() As String
Var n as integer = ChartArray.LastIndex(2)
Var j as integer = GraphChoicePopupMenu.SelectedRowIndex
for i as integer = 0 to n
GraphData.add(ChartArray(j,i))
TimeData.Add(ChartArray(0,i).ToString)
next
MainGraphDataChart.Title = “Graph of” +GraphChoicePopupMenu.SelectedRowText
MainGraphDataChart.Mode = DesktopChart.modes.Line
MainGraphDataChart.GridColor = Color.Clear
Var ds As New ChartLinearDataset(GraphChoicePopupMenu.SelectedRowText, Color.red, True, GraphData)
ds.ChartType = ChartLinearDataset.ChartTypes.Line
MainGraphDataChart.AddDatasets ds