WPF,图表控件
开源代码地址:https://github.com/bearhanQ/WPFFramework;
QQ群:332035933;


<UserControl x:Class="WpfBootstrap.View.ChartsView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:WpfBootstrap.View"
xmlns:s="clr-namespace:System;assembly=mscorlib"
xmlns:m="clr-namespace:WpfBootstrap.Model"
xmlns:cc="clr-namespace:WPFTemplate;assembly=WPFTemplate"
xmlns:p="clr-namespace:WpfBootstrap.Common"
xmlns:vws="clr-namespace:WpfBootstrap.View"
mc:Ignorable="d"
d:DesignHeight="600" d:DesignWidth="400">
<UserControl.Resources>
<x:Array x:Key="revenueInfo" Type="{x:Type m:Revenue}">
<m:Revenue Day="周一" Value="1000000"/>
<m:Revenue Day="周二" Value="1500000"/>
<m:Revenue Day="周三" Value="2000000"/>
<m:Revenue Day="周四" Value="5000000"/>
<m:Revenue Day="周五" Value="2500000"/>
<m:Revenue Day="周六" Value="3000000"/>
<m:Revenue Day="周七" Value="1000000"/>
</x:Array>
<p:BarValueWarningConverter x:Key="BarValueWarningConverter"/>
<Style x:Key="barStyle1" TargetType="{x:Type cc:Bar}">
<Setter Property="ItemContainerStyle">
<Setter.Value>
<Style TargetType="{x:Type cc:BarItem}" BasedOn="{StaticResource {x:Type cc:BarItem}}">
<Style.Triggers>
<DataTrigger Binding="{Binding RelativeSource={RelativeSource Mode=Self}, Path=Value,Converter={StaticResource BarValueWarningConverter},ConverterParameter=2000000}" Value="True">
<DataTrigger.Setters>
<Setter Property="Background" Value="#FFF4D505"/>
</DataTrigger.Setters>
</DataTrigger>
<DataTrigger Binding="{Binding RelativeSource={RelativeSource Mode=Self}, Path=Value,Converter={StaticResource BarValueWarningConverter},ConverterParameter=3000000}" Value="True">
<DataTrigger.Setters>
<Setter Property="Background" Value="Red"/>
</DataTrigger.Setters>
</DataTrigger>
</Style.Triggers>
</Style>
</Setter.Value>
</Setter>
</Style>
</UserControl.Resources>
<cc:CornerScrollViewer>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="300"/>
<RowDefinition Height="300"/>
<RowDefinition Height="300"/>
</Grid.RowDefinitions>
<cc:Bar ItemsSource="{StaticResource revenueInfo}" ValueMemberPath="Value" DisplayMemberPath="Day" Style="{StaticResource barStyle1}"/>
<cc:Donut ItemsSource="{StaticResource revenueInfo}" ValueMemberPath="Value" DisplayMemberPath="Day"
Grid.Column="1" ArcThickness="60" Orientation="Vertical"/>
<cc:LineChart Grid.Row="1" ItemsSource="{StaticResource revenueInfo}" DisplayMemberPath="Day" ValueMemberPath="Value" OpenAnimation="False"/>
<cc:CurveChart Grid.Row="1" Grid.Column="1" ItemsSource="{StaticResource revenueInfo}"
DisplayMemberPath="Day" ValueMemberPath="Value" OpenAnimation="False"
Stroke="Red"/>
<cc:StepChart Grid.Row="2" ItemsSource="{StaticResource revenueInfo}" Stroke="#FF0CFF00"
DisplayMemberPath="Day" ValueMemberPath="Value" OpenAnimation="False"/>
</Grid>
</cc:CornerScrollViewer>
</UserControl>
public class Revenue
{
public string Month { get; set; }
public string Day { get; set; }
public string Profits { get; set; }
public int Value { get; set; }
}
WPF,图表控件的更多相关文章
- Visifire For WPF 图表控件 如何免费
可能用WPF生成过图表的开发人员都知道,WPF虽然本身的绘图能力强大,但如果每种图表都自己去实现一次的话可能工作量就大了, 尤其是在开发时间比较紧的情况下.这时候有必要借助一种专业的图表工具. Vis ...
- 一款开源免费的WPF图表控件ModernuiCharts
一款简洁好看的Chart控件 支持WPF.silverlight.Windows8 ,基本够用,主要是开源免费的.(商业控件ComponentOne for WPF要4w多呢) This proj ...
- WPF 图表控件之曲线绘制与移动
目的:绘制简单轻量级的曲线视图 二.实现效果: 1,绘制标准基准线 2,可拖动 三.用到控件 1,Canvas 2,Ellipse XAML代码: <Canvas Background=&quo ...
- WPF Visifire 图表控件
Visifire WPF 图表控件 破解 可能用WPF生成过图表的开发人员都知道,WPF虽然本身的绘图能力强大,但如果每种图表都自己去实现一次的话可能工作量就大了, 尤其是在开发时间比较紧的情况下.这 ...
- WPF 曲线图表控件(自制)(二)
原文:WPF 曲线图表控件(自制)(二) 版权声明:本文为博主原创文章,未经博主允许不得转载. https://blog.csdn.net/koloumi/article/details/775218 ...
- WPF 曲线图表控件(自制)(一)
原文:WPF 曲线图表控件(自制)(一) 版权声明:本文为博主原创文章,未经博主允许不得转载. https://blog.csdn.net/koloumi/article/details/775092 ...
- 【WPF】 OxyPlot图表控件学习
最近在学习OxyPlot图表控件,一些基本的学习心得,在这里记录一下,方便以后进行查找. 一.引用 OxyPlot控件可以直接在VS的 " Nuget " 里面下载 选择: ...
- C# WPF DevExpress 图表控件之柱状图
说明:DevExpress版本是17.1.VS是2015. XAML: <!--#region 图表控件--> <dxc:ChartControl x:Name="char ...
- [深入浅出Windows 10]QuickCharts图表控件库解析
13.4 QuickCharts图表控件库解析 QuickCharts图表控件是Amcharts公司提供的一个开源的图表控件库,这个控件库支持WPF.Silverlight.和Windows等 ...
- WPF第三方控件盘点
WPF统一的编程模型.语言和框架,实现了界面设计人员和开发人员工作可以分离的境界,鉴于WPF强大的优势,且一直是开发者关注的地方,下面和大家分享基于WPF项目开发需要用到的第三方控件,包括业界最受好评 ...
随机推荐
- 2024-06-15:用go语言,Alice 和 Bob 在一个环形草地上玩一个回合制游戏。 草地上分布着一些鲜花,其中 Alice 到 Bob 之间顺时针方向有 x 朵鲜花,逆时针方向有 y 朵鲜花
2024-06-15:用go语言,Alice 和 Bob 在一个环形草地上玩一个回合制游戏. 草地上分布着一些鲜花,其中 Alice 到 Bob 之间顺时针方向有 x 朵鲜花,逆时针方向有 y 朵鲜花 ...
- azure 代码管理器网址
visual studio 团队资源管理器 azure代码管理网页 记录一下 https://dev.azure.com
- 一行超长日志引发的 “血案” - Containerd 频繁 OOM 背后的真相
案发现场:混沌初现 2024年6月10日,本应是平静的一天.但从上午 9 点开始,Sealos 公有云的运维监控告警就开始不停地响.北京可用区服务器节点突然出现大量 "not ready&q ...
- Asp.net core Swashbuckle Swagger 的常用配置
背景 .net core Swashbuckle Swagger 官方文档:https://github.com/domaindrivendev/Swashbuckle.AspNetCore 我们发现 ...
- 码农的转型之路-全力以赴升级物联网浏览器(IoTBrowser)
在人生的重要时刻,我站在了毕业的门槛上,望着前方的道路,心中涌动着对未来的无限憧憬与些许忐忑.面前,两条道路蜿蜒伸展:一是继续在职场中寻求稳定,一是勇敢地走出一条属于自己的创新之路.尽管面临年龄和现实 ...
- Freertos学习:05-内核控制
--- title: rtos-freertos-05-kernel-control date: 2020-06-22 11:10:19 categories: tags: - kernel - fr ...
- 工控必备!NXP i.MX 8M Mini开发板规格书资料分享,高性能低功耗!
1 核心板简介 创龙科技SOM-TLIMX8-B是一款基于NXP i.MX 8M Mini的四核ARM Cortex-A53 + 单核ARM Cortex-M4异构多核处理器设计的高端工业级核心板,A ...
- HiAI Foundation开发平台,加速端侧AI应用的智能革命
如果您是一名开发者,正在寻找一种高效.灵活且易于使用的端侧AI开发框架,那么HarmonyOS SDKHiAI Foundation服务(HiAI Foundation Kit)就是您的理想选择. 作 ...
- 【原创软件】第2期:CAD文字快速批量替换工具CFR(CAD_FastReplace_V4)
01 背景 由于工作需要,开发了一套CAD文字快速批量替换软件CFR.主要目的是:实现dwg文件一次性完成单对/多对词组快速批量替换. 02 主要功能特色 (1)无需打开CAD,快速实现文字批量替换. ...
- iOS开发基础102-后台保活方案
iOS系统在后台执行程序时,有严格的限制,为了更好地管理资源和电池寿命,iOS会限制应用程序在后台的运行时间.然而,iOS提供了一些特定的策略和技术,使得应用程序可以在特定场景下保持后台运行(即&qu ...