Need Help Quickchart Label and database

I want to create a chart, just like the one shown in the image. Exactly the same. But when I use the expressions provided below, the [channel] label shows incorrectly. Can you tell me what mistake I am making? I want the label to be created for the row data where [LOT STATUS] = "OPEN", and the percentage should be shown accordingly.

I WANT THISI WANT THIS

"https://quickchart.io/chart?c=" & ENCODEURL(
  CONCATENATE(
    '
    {
      "type": "outlabeledPie",
      "data": {
        "labels": [', '"', SUBSTITUTE(SELECT(PHOTOS[CHANNEL], AND([LOT STATUS] = "OPEN"), true)), ",", '","'), '"', '],
        "datasets": [{
          "backgroundColor": ["#FF3784", "#36A2EB", "#4BC0C0", "#F77825", "#9966FF","#EAA81B","#5D7612","#4B167A","#AD1B8C","#AD1B4E","#5A132C","#B9293F","#2D0C47","#B37BC1","#4DA973"],
          "data": [', SELECT(PHOTOS[QUANTITY], AND([LOT STATUS] = "OPEN"), true)), ']
        }]
      },
      "options": {
        "plugins": {
          "legend": false,
          "outlabels": {
            "text": "%l %p",
            "color": "white",
            "stretch": 35,
            "font": {
              "resizable": true,
              "minSize": 12,
              "maxSize": 18
            }
          }
        }
      }
    }
    '
  )
)

 

0 9 423
9 REPLIES 9

Have you watched this yet?

I know it's not the same type of chart, but that doesn't really matter too much.

The basics of getting things working is the same for most chart types with QuickChart.io

So if you can get a line chart working, you can get others working just as well.  (See here)

Hi @MultiTech 

Can you please tell me what I should correct?

It can be difficult to debug these issues, as there is a lot of fiddly bits that can get in the way; everything has to be character perfect, so one wrong thing (a comma out of place, and extra space when you should have one) and things break.

I asked Appster, and it pointed out that you're trying to use Substitute() with a Select():

-----------------------------------------------------------------------------------------------------------

Observations:

  1. String Concatenation in CONCATENATE:

    • When using quotes inside CONCATENATE, ensure they are escaped properly or enclosed in another set of single/double quotes consistently.
  2. SELECT Syntax:

    • SELECT is used incorrectly inside the SUBSTITUTE function. SELECT generates a list, and you are trying to apply SUBSTITUTE on it as if it's a single string.
    • You cannot concatenate a list directly without handling the formatting first.
  3. JSON Structure:

    • JSON strings in CONCATENATE need consistent quotes, commas, and brackets. Mixing single and double quotes without proper escaping can cause the formula to break.
  4. Extraneous Parentheses:

    • There are mismatched or misplaced parentheses in your formula.

-----------------------------------------------------------------------------------------------------------

Try and debug these issues if you can.  I would highly advise engaging with Appster; while it has its limitations, it's much better than vanilla chatGPT.

Hope it helps!

I have provided an image of my sheet below, and I want to create a pie chart from it. I would like the pie chart to display the percentage of [Lot Status] 'Open' grouped by channel. Please help me. @AleksiAlkio  @Suvrutt_Gurjar @WillowMobileSys @MultiTech 

Screenshot 2024-12-25 144739.png

 

well I tried

MultiTech_0-1735140677734.png

 

Can you correct this expression and send it back to me?

Can u show the error or the image that its create appsheet? maybe i can help u.

i will show u a example of mine using that chart.

"https://quickchart.io/chart?width=1000&height=300&c=" & ENCODEURL(
  CONCATENATE(
    "{
  'type': 'outlabeledPie',
  'data': {
    'labels': ['Completadas', 'En curso', 'No iniciadas', 'Canceladas'], 
    'datasets': [{
        'backgroundColor': ['#00DF80', '#FFBA71', '#DFDFDE', '#CD5C5C'],  
        'data': [",[Concatenaciรณn de conteos de tareas],"]  
    }]
  },
  'options': {
    'plugins': {
      'legend': false,
      'outlabels': {
        'text': '%l %p', 
        'color': 'white',
        'stretch': 35,
        'font': {
          'resizable': true,
          'minSize': 12,
          'maxSize': 18
        }
      }
    }
  }
}"
)
)

here a example of one of the VC "tareas en curso"

text(COUNT(
  SELECT(
    TAREAS[TAREA ID],
    AND(
      [PROYECTO] = [_THISROW].[id_proyectos],
      [ESTADO DE TAREA] = "en curso",
      [ASIGNADO A] = [_THISROW].[id_equipos]
    )
  )
))

and the code of the VC of data:

concatenate(text([Conteo de tareas completadas]),",",[Conteo de tareas en curso],",",[Conteo de tareas no iniciadas],",",[Conteo de tareas canceladas])

As u can see i like to use almost for all the code VC because for me is easier to fix the code, a good example for understanding these quickcharts codes is putting the original code and trying to urdestand how it works to put in appsheen then.

Sorry for my bad english, i hope it helps u.

 

 

I am not able to understand what you want to tell. 

I'm sorry, I thought that if you saw the example of my code it could guide you to make yours, why don't you try to create the virtual columns separately and that way it will be easier for you to see where the error is?

In my case, what I do is create virtual columns and compare their code with the original Quickchart code.