引用:LiveCharts,LiveCharts.Wpf

1. 示例

折线图

<Window
...
xmlns:lvc="clr-namespace:LiveCharts.Wpf;assembly=LiveCharts.Wpf">
<lvc:CartesianChart>
//折线
<lvc:CartesianChart.Series>
<lvc:LineSeries Title="" Values=""/>
</lvc:CartesianChart.Series>
<lvc:CartesianChart.AxisX>
// X 轴名称
<lvc:Axis Labels="0,1,2,..." Title="时间/小时">
<lvc:Axis.Separator>
<lvc:Separator StrokeThickness="0" Step="1"/>
</lvc:Axis.Separator>
</lvc:Axis>
</lvc:CartesianChart.AxisX>
<lvc:CartesianChart.AxisY>
// Y 轴名称
<lvc:Axis MinValue="0" MaxValue="10" Title="拥堵指数">
<lvc:Axis.Separator>
<lvc:Separator StrokeThickness="0" Step="1.0"/>
</lvc:Axis.Separator>
// 垂直方向上添加横条
<lvc:Axis.Sections>
<lvc:AxisSection Value="0" StrokeThickness="2" Fill="White"/>
<lvc:AxisSection Value="0" SectionWidth="2" Fill="#FF2CC12F"/>
<lvc:AxisSection Value="2" SectionWidth="4" Fill="#FF2CC12F"/>
</lvc:Axis.Sections>
</lvc:Axis>
</lvc:CartesianChart.AxisY>
<lvc:CartesianChart.DataTooltip>
<lvc:DefaultTooltip Foreground="#FFB1E2FF" Background="#99000000"></lvc:DefaultTooltip>
</lvc:CartesianChart.DataTooltip>
<lvc:CartesianChart>
</Window>

数据比例源:

xxSeriesCollection = new SeriesCollection {
new PieSeries
{
Title = "A",
Values = new ChartValues<double> { 5 },
DataLabels = false,
Fill = new SolidColorBrush(Color.FromRgb(24, 145, 247)),
Stroke = transparent,
},
new PieSeries {...}
}

2. 其他

  1. LegendLocation 表示标识(标题+颜色)放在哪里;none 表示不显示;
  2. InnerRadius 表示饼状图的空心半径;
  3. LegendLocation 的尺寸
  4. toolTip

3. 源码和文档

  1. github https://github.com/Live-Charts/Live-Charts/tree/master/WpfView
  2. https://lvcharts.net/App/documentation/beta/wpf/LiveCharts-Wpf-Axis

WPF 应用 - 图表 LiveCharts的更多相关文章

  1. WPF绘制图表-LiveCharts

    LiveCharts是一款非常好用的WPF图表绘制类库,相比其他同类类库,LiveCharts的UI风格样式更加多样更加美观.  准备工作:安装以下两个类库: 1.甘特图 前台View代码 1 < ...

  2. WPF 曲线图表控件(自制)(二)

    原文:WPF 曲线图表控件(自制)(二) 版权声明:本文为博主原创文章,未经博主允许不得转载. https://blog.csdn.net/koloumi/article/details/775218 ...

  3. WPF 曲线图表控件(自制)(一)

    原文:WPF 曲线图表控件(自制)(一) 版权声明:本文为博主原创文章,未经博主允许不得转载. https://blog.csdn.net/koloumi/article/details/775092 ...

  4. WPF/Winform 图表库LiveCharts

    早前的博客,自己动手写了几个图表饼状图,柱形图,折线图等,重在思路. 那么如果你不想这么麻烦自己动手,有没有现成的图表库那? 当然有,虽然我也刚开始用没多久,不过还是对这么良心的项目充满了敬佩!! g ...

  5. WPF LiveChart 图表详解

    //参考网址:https://www.cnblogs.com/zh7791/p/12617961.html 本文主要介绍LiveChart.WPF 中的图表的使用方法 类: 数据绑定, 数据显示样式等 ...

  6. WPF - 使用WPF创建图表

    最近有点想把自己的项目里面加入图表,让程序看起来高大上起来.没办法,很大一部分要靠包装,使用好图表,让程序图文并茂,就是包装的一个好法子.. WPF toolkit里面有常见的图表控件 如何使用: h ...

  7. WPF Visifire 图表控件

    Visifire WPF 图表控件 破解 可能用WPF生成过图表的开发人员都知道,WPF虽然本身的绘图能力强大,但如果每种图表都自己去实现一次的话可能工作量就大了, 尤其是在开发时间比较紧的情况下.这 ...

  8. WPF 自定义图表(柱状图,曲线图)

    1.功能 实现图表的数据绑定,动态绑定,属性更改绑定. 本文提供了一种思路. 2.原理 使用canvas绘制,使用反射来确定属性的绑定. 3.效果: 柱状图效果: 曲线图效果: 感谢阅读. 源码地址: ...

  9. C# WPF DevExpress 图表控件之柱状图

    说明:DevExpress版本是17.1.VS是2015. XAML: <!--#region 图表控件--> <dxc:ChartControl x:Name="char ...

随机推荐

  1. 001、Python数据结构

    #! usr/bin/env python # _*_ coding:utf-8 _*_ from random import randint ''' 一.list的增删改查 1.list.appen ...

  2. k8s二进制部署 - 总结

    镜像仓库: 安装软件:docker.docker-compose.harbor.nginx 1.下载cfssl.cfssljson.cfssl-certinfo,增加执行权限并放在PATH环境变量路径 ...

  3. 重学c#————struct

    前言 简单整理一下struct. 正文 struct 对于struct 而言呢,我们往往会拿class作为对比,但是呢,我们在初学阶段用class来替代struct,struct的存在感越来越低了. ...

  4. git-reset All In One

    git-reset All In One git 撤销 merge $ git checkout feature-sentry $ git pull $ git checkout dev $ git ...

  5. Linux command find All In One

    Linux command find All In One $ find -h # find: illegal option -- h # usage: # find [-H | -L | -P] [ ...

  6. js & void & undefined & null

    js & void & undefined & null The void operator evaluates the given expression and then r ...

  7. Web Components & HTML template & HTML slot

    Web Components & HTML template & HTML slot https://github.com/xgqfrms/es-next/issues/2 live ...

  8. Chrome V8 系统架构

    Chrome V8 系统架构 Chromium 多进程多线程架构 design-documents https://www.chromium.org/developers/design-documen ...

  9. Excel和CSV格式文件的不同之处

    来源:https://blog.csdn.net/weixin_39198406/article/details/78705016 1.个人理解:为何选择使用csv来存储接口测试用例相关字段数据,而不 ...

  10. C++算法代码——纪念品分组[NOIP2007 普及组]

    题目来自:http://218.5.5.242:9018/JudgeOnline/problem.php?id=1099 https://www.luogu.com.cn/problem/P1094 ...