简体   繁体   English

散景库中的滑块文本颜色更改

[英]slider text color change in bokeh lib

In bokeh lib slider , text_input , radio_button etc. are all white background and black text (default). 在bokeh lib slidertext_inputradio_button等都是白色背景和黑色文本(默认)。 I looked at bokeh website https://bokeh.pydata.org/en/latest/docs/user_guide/styling.html and saw there line properties (line color, width, etc.), fill properties (fill color, alpha, etc.), text properties (font styles, colors, etc.) 我查看了bokeh网站https://bokeh.pydata.org/en/latest/docs/user_guide/styling.html ,在那里看到了线属性(线颜色,宽度等),填充属性(填充颜色,alpha等) 。),文本属性(字体样式,颜色等)

My question is how can I change the fill color and text color (by using fill_color, text_color?) 我的问题是如何更改填充颜色和文本颜色(通过使用fill_color,text_color?)

Those properties only apply to things that are drawn on the plot canvas, ie glyphs and annotations. 这些属性仅适用于在绘图画布上绘制的内容,即字形和注释。 The widgets are DOM elements and by and large configurable using standard CSS rather than property attributes (ie you can embed a Bokeh document in a Jinja template that has CSS rules to style widget properties). 这些小部件是DOM元素,并且基本上可以使用标准CSS而不是属性属性进行配置(即,您可以将Bokeh文档嵌入具有CSS规则的Jinja模板中,以对小部件属性进行样式设置)。 However, if you are just interested in the bar color, that one in particular is configurable with the bar_color property, eg 但是,如果您仅对条形颜色感兴趣, 可以使用bar_color属性对其进行配置,例如

Slider(..., bar_color="red")

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM