如何将pyecharts tree 树图 各枝干颜色设定为不同颜色?

如何将pyecharts tree 树图 各枝干颜色设定为不同颜色?

from pyecharts import options as opts
from pyecharts.charts import Tree

def tree_base(_data, _filename):
    sf_file_path = os.path.join(os.path.abspath(os.path.dirname(__file__)),
                                r'..\tree_{}.html'.format(_filename))
    tree = (
        Tree(init_opts=opts.InitOpts(height="2400px", width="2000px"))
            .add("", data=_data, is_roam=True, initial_tree_depth=-1, symbol_size=4)
            .set_global_opts(title_opts=opts.TitleOpts(title="test"))
            .set_series_opts(leaves_label_opts=opts.LabelOpts(font_size=10)))
    tree.render(sf_file_path)
    return tree

_data = [{'name': 'e1', 'children': [{'name': 'e7', 'children': [{'name': 'e90'}, {'name': 'e8', 'children': [{'name': 'e9'}]}]}, {'name': 'e2'}]}]
tree_base(_data, "123")

像这样:

img

不知道你这个问题是否已经解决, 如果还没有解决的话:

如果你已经解决了该问题, 非常希望你能够分享一下解决方案, 以帮助更多的人 ^-^