Hello, i want to show a mark line in the in the histogram for the XAxis when a value is in a specific range, but in Studio i can only use the mark line in the YAxis for avarage, min, max or a specific value, how can i use this in the xAxis to specifying a value?
Histogram mark line
emoya
#2
Yes there is a way to do that, but you need to know in where range is the value you want to show, let me show you an example using an event in your histogram:
// this event should be executed just one time
.once("execute:stop", () => {
const viz = cf.getVisualization('histogram_id');// this is your histogram
const data = viz.get("data"); // you get then data
// here you get the position of the value you want to show
const pos = data.findIndex(d => {
return Number(your_value) >= d.group[0][0] && Number(your_value) < d.group[0][1];
});
// Create the line
let lines = cf.MarkLine()
.data([
{"xAxis": pos, "label": { "show": false } }
]);
// set the line and execute with no query
viz.set("markline", lines);
viz.execute(false);
})
sergioSan
#3
It works good, but the markline does not show the value, is there a way to show the value that is selected?
emoya
#4
Actually, no, you should not show the value of the mark line because is the value of the position of the range, not. the value in that range