B4J Question Passing .csv coordinates to Scatter Chart

Discussion in 'B4J Questions' started by Cal4th, Jan 5, 2018.

  1. Cal4th

    Cal4th Member

    I am trying to plot coordinates that i have in a .csv file that is divided by ",". the .csv looks like this:
    Being the first number the X coordinate and the second the Y coordinate
    The code Im using is :
    Code:
    Public XY As List
        XY.Initialize
        XY = su.LoadCSV(
    File.DirApp, "coordinates.csv"",")
        
    Dim Plot As XYSeries
        Plot.Initialize(
    "plot")
        
    For i= 0 To XY.Size-1
            
    Dim c(2As Double = XY.Get(i)
       Plot.Add(c(
    0), c(1))
        
    Next
    ScatterChart.AddSeries(Plot)
    When I load the file it is saved as this:

    XY
    Element Data
    • 0
      • 0=1
      • 1=0.00158
    • 1
      • 0=0.95
      • 1=0.01008
    • 2
      • 0=0.9
      • 1=0.0181
    etc...

    I am trying to plot them as shown in https://www.b4x.com/android/forum/threads/passing-data-from-csv-to-scatter-chart-of-jchart.87910/
    but is not working.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice