help with image colum SVG code

Hello friends!

I'm just starting on this fantastic platform, AppSheet, and I'm currently developing a project management app. I'm trying to include a Gantt chart in my project view table using QuickChart, but I'm encountering some issues. Here's the code I'm trying:

"https://quickchart.io/chart?c=" & encodeurl(
    concatenate(
        "{",
        "\"type\": \"horizontalBar\",",
        "\"data\": {",
        "\"labels\": ", [listado de actividades], ",",
        "\"datasets\": [{",
        "\"data\": [", [inicio de actividades], ",", [fin planeado de actividades], "],",
        "\"backgroundColor\": [",
        "\"rgba(255, 99, 132, 1.0)\", \"rgba(255, 99, 132, 1.0)\", \"rgba(255, 206, 86, 1.0)\", \"rgba(255, 206, 86, 1.0)\", \"rgba(255, 206, 86, 0.2)\", \"undefined\"",
        "]",
        "}],",
        "\"options\": {",
        "\"legend\": {\"display\": false},",
        "\"annotation\": {",
        "\"annotations\": [{",
        "\"type\": \"line\",",
        "\"mode\": \"vertical\",",
        "\"scaleID\": \"x-axis-0\",",
        "\"value\": \"", [plazo_text], "\"",
        "}]",
        "},",
        "\"scales\": {",
        "\"xAxes\": [{",
        "\"position\": \"top\",",
        "\"type\": \"time\",",
        "\"time\": {\"unit\": \"month\"},",
        "\"ticks\": {\"min\": \"new Date(2024-01-01)\", \"max\": \"new Date(2024-12-31)\"}",
        "}]",
        "}",
        "}"
    )
)

Here are the formulas for your columns:

  • Listado de actividades: substitute(concatenate("[", text(list([actividades relacionadas][actividad])), "]"), " ", "")
  • Inicio de actividades: substitute(concatenate("[", text(list([actividades relacionadas][inicio])), "]"), " ", "")
  • Fin planeado de actividades: substitute(concatenate("[", text(list([actividades relacionadas][fin planeado])), "]"), " ", "")
  • Plazo: substitute(concatenate("[", text([plazo]), "]"), " ", "")

These columns are primarily date types, except for the activities, which are text. However, I'm unable to visualize the chart due to the error:

Error: unexpected token -1:2

What am I doing wrong?

0 2 154
2 REPLIES 2

What happens if you write your values directly to your URL? Does it work then? With that way you can be sure are your app formulas wrong or the URL itself.

I already did, but i checked that its better to create the virtual columns as supports and u will have a cleaner code, i think that the error its on the  , or /  for that reason appears Error: unexpected token -1:2

 

_________________________________________________________________________________________

 

i already created the virtual columns for each one and tested and it works:

for [PLAZO TEXT] = [11/3/2024]

 

for [LISTADO DE ACTIVIDADES]= [AplicaciónDeAntifouling,ReparaciónDeIngresoDeAguaPorBujesDeTimones,AplicaciónDeSellanteATapasDeArbotantes,ReemplazoDeTerminalesDeSistemaDeAterrizajeTimones]

for inicio and fin = [4/3/2024,7/3/2024,8/3/2024,9/3/2024]

 

thats the output formats of that virtual columns.

 

 

Top Labels in this Space