Error Quick Chart

Pls, Help me

 

I Want create expressions quick chart, but error like this

 

ADAJALAN_0-1746539894890.pngADAJALAN_1-1746539909492.png

My expressions :

CONCATENATE(
"https://quickchart.io/chart?c=
{ type: 'bar',
data: { datasets:
[ { data: [",[PROGRESS (PLAN)]* 100,",",[PROGRESS (PLAN)]* 100,",",[DEVIASI]* 100,"], backgroundColor: [ 'rgb(255, 99, 132)', 'rgb(255, 159, 64)', 'rgb(255, 205, 86)', ],
label: 'Plan VS Actual', }, ],
labels: ['Plan', 'Actual', 'Deviasi'],},
options: {
plugins: {
datalabels: {
anchor: 'end',
align: 'top',
color: '#fff',
backgroundColor: 'rgba(34, 139, 34, 0.6)',
borderColor: 'rgba(34, 139, 34, 1.0)',
borderWidth: 1,
borderRadius: 5,
formatter: (value) => {
return value + 'k';
}
}
}
}
}

")

1 1 185
1 REPLY 1

The issue seems to be related to incorrect string formatting in your CONCATENATE expression for QuickChart. JSON strings require proper escaping, especially when used in URLs. Here's a corrected version of your formula with properly escaped characters:

 

CONCATENATE(

  "https://quickchart.io/chart?c=",

  "{",

  "type: 'bar',",

  "data: {",

  "datasets: [",

  "{",

  "data: [", [PROGRESS (PLAN)] * 100, ",", [PROGRESS (PLAN)] * 100, ",", [DEVIASI] * 100, "],",

  "backgroundColor: [ 'rgb(255, 99, 132)', 'rgb(255, 159, 64)', 'rgb(255, 205, 86)' ],",

  "label: 'Plan VS Actual'",

  "}",

  "],",

  "labels: ['Plan', 'Actual', 'Deviasi']",

  "},",

  "options: {",

  "plugins: {",

  "datalabels: {",

  "anchor: 'end',",

  "align: 'top',",

  "color: '#fff',",

  "backgroundColor: 'rgba(34, 139, 34, 0.6)',",

  "borderColor: 'rgba(34, 139, 34, 1.0)',",

  "borderWidth: 1,",

  "borderRadius: 5,",

  "formatter: (value) => { return value + 'k'; }",

  "}",

  "}",

  "}",

  "}"

)

 

Key Changes:

 

1. Proper Escaping: JSON strings must be properly escaped for use in URLs. Ensure you escape any special characters like quotes (') and spaces.

 

 

2. CONCATENATE Format: Separate each line and ensure concatenation is continuous.

 

 

 

Debugging Tips:

 

Use a JSON validator to confirm that the JSON inside the URL is valid.

 

If the issue persists, test the generated URL in your browser to pinpoint formatting problems.

 

 

 

 

 

Top Labels in this Space