Hello all,
found another feature which i dont know is correct or wrong. when I use mute for circle glymth and also hover tool with “Fill color” parameter then when I hover over muted glympth the “hover_fill_color” is still populated. See video.
Code:
from bokeh.plotting import show, figure
from bokeh.models import DataRange1d
from bokeh.models import CrosshairTool, Span
from bokeh.models import HoverTool
from bokeh.models import ColumnDataSource
from bokeh.models import Legend
import pandas
# Defaults
Figure_sizing_mode = "stretch_width"
Figure_height=350
X_Seris_Format = "linear"
X_Series_Column = "TAH_Order"
# ToolTip
ToolTip = [
("Category", "@Category"),
("Date", "@TAH_Date{%F}"),
("Max", "@Max_value{0.00}"),
("Min", "@Min_value{0.00}")]
ToolTip_Format = {
"@Category": "numeral",
"@TAH_Date": "datetime",
"@Max_value": "numeral",
"@Min_value": "numeral"}
# Data
Value_dict = {
"TAH_Order": [1,2,3,4,5,6,7,8,9,10],
"TAH_Date": ["2023-06-01","2023-06-01","2023-06-02","2023-06-02","2023-06-03","2023-06-03","2023-06-04","2023-06-04","2023-06-05","2023-06-05"],
"Category": ["CAT1","CAT1","CAT1","CAT1","CAT1","CAT1","CAT1","CAT1","CAT1","CAT1"],
"Max_value": [44,11,29,32,29,43,49,35,29,50],
"Min_value": [1,3,9,4,12,11,3,7,10,17]}
Value_df = pandas.DataFrame(data=Value_dict)
DataSource = ColumnDataSource(data = Value_df)
# Tools
# Hover Tool
Hover_Tool = HoverTool()
Hover_Tool.tooltips = ToolTip
Hover_Tool.muted_policy = "ignore"
Hover_Tool.formatters = ToolTip_Format
Hover_Tool.mode = "vline"
# Crosshair
Span_height = Span(dimension="height", line_dash="dashed", line_width=2, line_color="#878787")
Crosshair_Tool = CrosshairTool(overlay=Span_height)
# Inactive
Chart_Legend = Legend()
Chart_Legend.inactive_fill_color = "white"
Chart_Legend.inactive_fill_alpha = 0.7
Chart_Legend.click_policy = "mute"
# Chart
Chart = figure(sizing_mode = Figure_sizing_mode, height=Figure_height, toolbar_location="below", x_axis_type=X_Seris_Format)
Chart.add_layout(Chart_Legend, "right")
# Chart - Lines
GS_Line_Max = Chart.line(x=Value_df["TAH_Order"], y=Value_df["Max_value"], line_width= 1, line_color = "red", line_join = "round", legend_label="Maximal", muted_alpha=0.2)
GS_Line_Min = Chart.line(x=Value_df["TAH_Order"], y=Value_df["Min_value"], line_width= 1, line_color = "green", line_join = "round", legend_label="Minimal", muted_alpha=0.2)
# Chart - Cycles --> ment to be in Hover Tool
GS_Cycles_Max = Chart.circle(source=DataSource, x=X_Series_Column, y="Max_value", size=10, fill_color = "white", line_color="red", hover_fill_color="red", legend_label="Maximal", muted_alpha=0.2)
GS_Cycles_Min = Chart.circle(source=DataSource, x=X_Series_Column, y="Min_value", size=10, fill_color = "white", line_color="green", hover_fill_color="green", legend_label="Minimal", muted_alpha=0.2)
Chart.add_tools(Hover_Tool)
Chart.add_tools(Crosshair_Tool)
Chart.hover.renderers = [GS_Cycles_Min]
show(Chart)
Link to video: Bokeh Circle Fill color for muted - YouTube
can it be somehow changed to use differnet color or muted alpha?
Thank you
Jan