Hello,
Currently, I have a line chart that shows lines related to datapoints when hovering:
Which I’ve managed to achieve with the following code:
code = """
const links = %s
const data = {'x0': [], 'y0': [], 'x1': [], 'y1': []}
const indices = cb_data.index.indices
for (var i = 0; i < indices.length; i++) {
const start = indices[i]
for (var j = 0; j < links[start].length; j++) {
const end = links[start][j]
data['x0'].push(circle.data.x[start])
data['y0'].push(circle.data.y[start])
data['x1'].push(circle.data.x[end])
data['y1'].push(circle.data.y[end])
}
}
segment.data = data
""" % links
callback = CustomJS(args={'circle': circle1.data_source, 'segment': sr1.data_source, 'line': line1.data_source}, code=code)
fig1.add_tools(HoverTool(tooltips=[
('Процент', '$y{0 %}'),
], callback=callback, renderers=[circle1]))
links is a dic which store the links between the points.
Do you know how I can just hilight the datapoints and show their values, not connecting them with line?
Thank you!