kagula
2019-3-18
这里用源代码的形式,示范如何画出一个最简单的动态曲线图。
开发环境,Visual studio 2017 Community Update5
项目类型: WPF C# .NetFramework 4.6.1
本文适用对象: 有两年没有开发C# WPF的程序员, 通过这个示例可以快速回忆。
下面是运行效果图,不停显示最新生成的十个数据点。
让程序跑起来分三步
第一步
新建WPF项目, 添加Reference, WPFVisifire.Charts.dll
第二步
修改xaml, 修改后的内容如下
<Window x:Class="testVisifire.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:vc="clr-namespace:Visifire.Charts;assembly=WPFVisifire.Charts"
xmlns:local="clr-namespa