Closed Ianna-Ding closed 2 months ago
代码如下: sankey = ( Sankey(init_opts=opts.InitOpts(width="4000px", height="1200px")) .add( "", nodes, links, node_width=90, node_gap = 20, node_align = "justify", pos_left = 'center', layout_iterations = 64, linestyle_opt=opts.LineStyleOpts(curve=0.4), label_opts=opts.LabelOpts( position="inside", color="white", font_size=12 ), edge_label_opt=opts.LabelOpts( is_show=True, position="right", formatter="{b}", color="grey", font_size=10, distance=2, ), ) .set_global_opts( legend_opts=opts.LegendOpts(is_show=False), ) ) 设置为right后,流线上的标签数据仍在每条流线的中间,这样会造成标签重合,请问我要怎样设置才能让流线标签显示在流线末尾(靠近target节点处)呢?
sankey = ( Sankey(init_opts=opts.InitOpts(width="4000px", height="1200px")) .add( "", nodes, links, node_width=90, node_gap = 20, node_align = "justify", pos_left = 'center', layout_iterations = 64, linestyle_opt=opts.LineStyleOpts(curve=0.4), label_opts=opts.LabelOpts( position="inside", color="white", font_size=12 ), edge_label_opt=opts.LabelOpts( is_show=True, position="right", formatter="{b}", color="grey", font_size=10, distance=2, ), ) .set_global_opts( legend_opts=opts.LegendOpts(is_show=False), ) )
代码如下:
sankey = ( Sankey(init_opts=opts.InitOpts(width="4000px", height="1200px")) .add( "", nodes, links, node_width=90, node_gap = 20, node_align = "justify", pos_left = 'center', layout_iterations = 64, linestyle_opt=opts.LineStyleOpts(curve=0.4), label_opts=opts.LabelOpts( position="inside", color="white", font_size=12 ), edge_label_opt=opts.LabelOpts( is_show=True, position="right", formatter="{b}", color="grey", font_size=10, distance=2, ), ) .set_global_opts( legend_opts=opts.LegendOpts(is_show=False), ) )
设置为right后,流线上的标签数据仍在每条流线的中间,这样会造成标签重合,请问我要怎样设置才能让流线标签显示在流线末尾(靠近target节点处)呢?