1

有没有办法改变或操作散景高级图表(如Chord 图表)中标签的字体大小和颜色?

Bokeh 提供了更改背景颜色等选项,但我似乎找不到任何方法来调整 Bokeh 或 css 中的标签。

任何帮助或建议将不胜感激。

4

1 回答 1

1

为了更改文本大小和颜色,您必须更改和弦图表渲染器中的字形。索引位置 3 的渲染器是文本字形渲染器,因此您可以在那里设置字体大小和颜色。

chord_from_df = Chord(source_data, source="name_x", target="name_y", value="value")
chord_from_df.renderers[3].glyph.text_font_size['value'] = '12pt'
chord_from_df.renderers[3].glyph.text_color = '#FF0000'
show(chord_from_df)
于 2017-08-01T15:31:57.637 回答