Expression in XY Chart Bullet Label Text

Is it possible to use an expression to only show labels when they are over a certain x value or y value, i.e. using {valueX} inside an expression?

current json below (without expression)
[
{
“enabled”: true,
“render”: “label”,
“width”: 1,
“height”: 1,
“label”: {
“text”: “{valueX}”,
“position”: {
“dx”: 1,
“dy”: -5
}
},
“tooltip”: {
“enabled”: true,
“text”: “{name}: [bold]{valueY}[/]”,
“cornerRadius”: 3,
“pointerLength”: 4,
“background”: {
“color”: “”,
“opacity”: 1
}
},
“fill”: {
“color”: “”,
“opacity”: 1
},
“stroke”: {
“color”: “”,
“width”: 1,
“opacity”: 1
},
“rotation”: 0,
“deriveFieldsFromData”: {
“fill”: {
“color”: “”,
“opacity”: “”
},
“stroke”: {
“color”: “”,
“opacity”: “”,
“width”: “”
},
“rotation”: “”
},
“heatRules”: {
“enabled”: false,
“max”: 100,
“min”: 2,
“dataField”: “”
}
}
]

Did you get this solved?
I have the same issue. Not sure how we can use logic with y / x value.

Did you try an expression binding on the text property to return the value? Something like:

if(
    {someTagValue} > 10,
    “{valueX}”,
    ""
)

Hi @Transistor ,

I tried that, but I’m getting a null first argument.

image

No I ended up switching to ApexCharts

Sorry, in the method I'm suggesting you would bind the text to another tag or property, not the {valueY} and that would turn on or off the text for all the points in that plot.

I wondering if it could read the values (valueY) and use the logic for each one.
The expression works fine if I need to reference it to a tag or specific value.

Thanks anyway.

The XY Chart component is based on
https://www.amcharts.com/docs/v4/chart-types/xy-chart/

It won’t support logic on the built-in variables.

1 Like

Sadly. But I understand.
I’ll find a workaround.

Thanks again!