Hello,
Does anyone know if itโs possible to use a formula for the chart color.
Basically if the value is negative, I want the color to be red. Green if positive.
did you try using โFormat Rulesโ?
It doesnโt seem like this applies to charts though.
Iโd like to get the color of the bar to change based on the value.
Oh, right. Iโm not aware of a way to do what you want. Maybe @Aleksi does?
Unfortunately thatโs trueโฆ itโs not possible at this moment. If you want to do that, you need to use other services where you can generate the chart through the URL and add that as an image to your app.
Is that using a webhook? I didnโt know that was possible.
For example this formula generates the URL and because itโs an image column, it will show it in the app.
CONCATENATE(โhttps://quickchart.io/chart?c=
{
type:โbarโ,
options: {
plugins: {
legend: false}},
data:{
labels: [โ0801โ,โ0802โ,โ0803โ,โ0804โ,โ0805โ,โ0806โ,โ0807โ,โ0808โ,โ0809โ,โ0810โ,โ0811โ,โ0812โ,โ0813โ,โ0814โ,โ0815โ,โ0816โ],
datasets:[{
data:[34,28,11,29,41,8,29,14,11,23,31,25,11,7,28,31],
backgroundColor:โredโ
}]
},
options:{
scales:{
xAxes:[{
barThickness:20,
}]
}
}
}โ)
Thanks! Iโll try this.
Hey Aleksi,
Iโm running into trouble setting this up using multiple columns. Itโs displaying โChart Error: unexpected identifier - 1:154โ
Can you tell what iโm doing wrong?
CONCATENATE(โhttps://quickchart.io/chart?c=
{
type:โbarโ,
options: {
plugins: {
legend: false}},
data:{
labels: [โ0โ,โ1โ,โ2โ,'3โ,โ4โ,โ5โ,โ6โ,โ7โ,โ8โ,โ9โ,โ10โ,โ11โ,โ12โ,โ13โ,โ14โ,โ15โ],
datasets:[{
data:{[Year 1],[Year 2],[Year 3],[Year 4],[Year 5],[Year 6],[Year 7],[Year 8],[Year 9],[Year 10],[Year 11],[Year 12],[Year 13],[Year 14],[Year 15]},
backgroundColor:โredโ
}]
},
options:{
scales:{
xAxes:[{
barThickness:20,
}]
}
}
}โ)
Youโre welcome
You need to make data an array so replace data:{โฆ} by data:[โฆ]
I tried it like this and it didnโt work. also tried removing the {} for datasets as well and it did nothing. I havenโt messed with these much so iโm not sure what I could be doing wrong.
CONCATENATE(โhttps://quickchart.io/chart?c=
{
type:โbarโ,
options: {
plugins: {
legend: false}},
data:{
labels: [โ0โ,โ1โ,โ2โ,'3โ,โ4โ,โ5โ,โ6โ,โ7โ,โ8โ,โ9โ,โ10โ,โ11โ,โ12โ,โ13โ,โ14โ,โ15โ],
datasets:[{
data:[[Year 1],[Year 2],[Year 3],[Year 4],[Year 5],[Year 6],[Year 7],[Year 8],[Year 9],[Year 10],[Year 11],[Year 12],[Year 13],[Year 14],[Year 15]],
backgroundColor:โredโ
}]
},
options:{
scales:{
xAxes:[{
barThickness:20,
}]
}
}
}โ)
Try withโฆ
data:["&[Year 1]&","&[Year 2]&"],
That worked great, thanks a lot!
Youโre welcome
User | Count |
---|---|
37 | |
26 | |
23 | |
17 | |
14 |