如何在winforms的实时图表中自定义图例? [英] How to customize legends in livecharts in winforms?
本文介绍了如何在winforms的实时图表中自定义图例?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在 winforms 中自定义 livecharts 中的图例?我试图得到一些像 this 这样的东西.
How to customize legends in livecharts in winforms ? I was trying to get some thing like this.
在实时图表 winforms 中,我只能看到这两个选项
In live chart winforms, I can only see these two options
scatterChart.LegendLocation = LegendLocation.Right;
scatterChart.DefaultLegend.Visibility = Visibility.Visible;
但这不会帮助我实现我在链接中显示的传奇.想知道一些解决办法.提前致谢.
But this wont help me to achieve a legend as I shown in the link. Would like to know some solutions. Thanks in advance.
推荐答案
我们可以创建一个 DefaultLegend 并将我们的属性添加到其中并分配给图表的 DefaultLegend 如下:
We can create a DefaultLegend and add our properties into it and assign to chart's DefaultLegend as follows :
DefaultLegend customLegend = new DefaultLegend();
customLegend.BulletSize = 15;
customLegend.Foreground = Brushes.White;
customLegend.Orientation = System.Windows.Controls.Orientation.Horizontal;
cartesianChart1.DefaultLegend = customLegend;
这篇关于如何在winforms的实时图表中自定义图例?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文