c# - 如何在winforms的实时图表中自定义图例?
问题描述
如何在winforms的实时图表中自定义图例?我试图得到这样的东西。
在实时图表winforms中,我只能看到这两个选项
scatterChart.LegendLocation = LegendLocation.Right;
scatterChart.DefaultLegend.Visibility = Visibility.Visible;
但这不会帮助我实现我在链接中显示的传奇。想知道一些解决方案。提前致谢。
解决方案
我们可以创建一个 DefaultLegend 并将我们的属性添加到其中并分配给图表的 DefaultLegend,如下所示:
DefaultLegend customLegend = new DefaultLegend();
customLegend.BulletSize = 15;
customLegend.Foreground = Brushes.White;
customLegend.Orientation = System.Windows.Controls.Orientation.Horizontal;
cartesianChart1.DefaultLegend = customLegend;
推荐阅读
- azure - Vbscript - OpenTextFile 在 Azure 中不起作用
- java - JSP - 不能从不同的 JSP 页面调用 java 变量?
- git - 如何避免“git gc”生成垃圾松散对象?
- html - 如何在 html5 datepicker 中禁用日期数组列表
- c# - 映射表达式
- java - 预期总是 0 ,当使用 @Mock
- javascript - 检查数组是否“包含”Javascript中的项目
- javascript - 当我在输入文本中输入 @ 时,它应该在反应中以不同的颜色显示
- redis - Redis key - value 的值版本控制
- java - Recycler View 中的多种视图设置不正确