Quickchart syntax

Linar
New Member

I am trying to use quickchart in my VC, but i get error โ€œChart error: Invalid or unexpected token -2:148โ€
This is what the formula looks like, what am I doing wrong?

concatenate(
โ€œhttps://quickchart.io/chart?bkg=white&c={
โ€œโ€œtypeโ€โ€: โ€œโ€œoutlabeledPieโ€โ€,
โ€œโ€œdataโ€โ€: {
โ€œโ€œlabelsโ€โ€: [โ€โ€œONEโ€", โ€œโ€œTWOโ€โ€, โ€œโ€œTHREEโ€โ€, โ€œโ€œFOURโ€โ€, โ€œโ€œFIVEโ€โ€],
โ€œโ€œdatasetsโ€โ€: [{
โ€œโ€œbackgroundColorโ€โ€: [""#FF3784"", โ€œโ€#36A2EB"", โ€œโ€#4BC0C0"", โ€œโ€#F77825"", โ€œโ€#9966FF""],
โ€œโ€œdataโ€โ€: [1, 2, 3, 4, 5]
}]
},
โ€œโ€œoptionsโ€โ€: {
โ€œโ€œpluginsโ€โ€: {
โ€œโ€œlegendโ€โ€: false,
โ€œโ€œoutlabelsโ€โ€: {
โ€œโ€œtextโ€โ€: โ€œโ€%l %p"",
โ€œโ€œcolorโ€โ€: โ€œโ€œwhiteโ€โ€,
โ€œโ€œstretchโ€โ€: 35,
โ€œโ€œfontโ€โ€: {
โ€œโ€œresizableโ€โ€: true,
โ€œโ€œminSizeโ€โ€: 12,
โ€œโ€œmaxSizeโ€โ€: 18
}
}
}
}
}"
)

Solved Solved
0 4 1,168
  • UX
1 ACCEPTED SOLUTION

Linar
New Member

By the highest standards the problem was the % symbol, the issue is closed

View solution in original post

4 REPLIES 4

Linar
New Member

By the highest standards the problem was the % symbol, the issue is closed

Yes you need to wrap that with ENCODEURL().

Hi, I was also working on the same thing and had an error (chart error: Error: unexpected token '; -1:3 quickchart). Have you done it successfully? If so, can I get an example of your corrected formula. I attached my formula, maybe you can help me to fix.

CONCATENATE("https://quickchart.io/chart?c=", ENCODEURL("{
"type": "outlabeledPie",
"data": {
"labels": ["ONE", "TWO", "THREE", "FOUR", "FIVE"],
"datasets": [{
"backgroundColor": ["#FF3784", "#36A2EB", "#4BC0C0", "#F77825", "#9966FF"],
"data": [1, 2, 3, 4, 5]
}],
},
"options": {
"plugins": {
"legend": false,
"outlabels": {
"text": "%l %p",
"color": "white",
"stretch": 35,
"font": {
"resizable": true,
"minSize": 12,
"maxSize": 18
}
}
}
}
}"))

You might find the following video helpful:

Top Labels in this Space