WinRTXamlToolkit在Win8.1实现统计图
【注1】WinRTXamlToolkit是免费控件,不过很久不更新了,而且网上的资源很少。后来我发现syncfusion控件有免费的community版本,并且有详细文档,所以就转过去使用syncfusion了。继续在WinRT/UWP奋战的亲们可以去围观一下:https://www.syncfusion.com/products/communitylicense
【注2】.Net平台各种免费和收费的包含Chart的控件:WinRTXamlToolkit/ModernUI/Visifire/Telerik/Syncfusion
【注3】WinRTXamlToolkit示例:http://eren.ws/2013/10/15/using-graphs-and-charts-in-windows-store-apps-boredom-challenge-day-11/

xmlns:Charting="using:WinRTXamlToolkit.Controls.DataVisualization.Charting"
<Grid Background="{StaticResource ApplicationPageBackgroundThemeBrush}">
<Charting:Chart x:Name="PieChart" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="100,100,0,0" Width="400" Height="400">
<Charting:PieSeries Margin="0" IndependentValuePath="Name" DependentValuePath="Amount" IsSelectionEnabled="True"/>
</Charting:Chart>
<Button x:Name="ButtonRefresh" Content="Refresh" HorizontalAlignment="Left" Margin="100,57,0,0" VerticalAlignment="Top" Click="ButtonRefresh_Click"/>
<Charting:Chart x:Name="ColumnChart" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="505,100,0,0" Width="399" Height="400">
<Charting:ColumnSeries Title="Smartphone Companies" Margin="0" IndependentValuePath="Name" DependentValuePath="Amount" IsSelectionEnabled="True"/>
</Charting:Chart>
<Charting:Chart x:Name="LineChart" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="909,100,-143,0" Width="600" Height="400">
<Charting:LineSeries Title="Smartphone Companies" Margin="0" IndependentValuePath="Name" DependentValuePath="Amount" IsSelectionEnabled="True"/>
</Charting:Chart>
<Charting:Chart x:Name="BarChart" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="100,505,0,-137" Width="600" Height="400">
<Charting:BarSeries Title="Smartphone Companies" Margin="0" IndependentValuePath="Name" DependentValuePath="Amount" IsSelectionEnabled="True"/>
</Charting:Chart>
<Charting:Chart x:Name="BubbleChart" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="705,505,0,-137" Width="600" Height="400">
<Charting:BubbleSeries Title="Smartphone Companies" Margin="0" IndependentValuePath="Name" DependentValuePath="Amount" IsSelectionEnabled="True"/>
</Charting:Chart>
</Grid>
public class FinancialStuff
{
public string Name { get; set; }
public int Amount { get; set; }
} private void LoadChartContents()
{
Random rand = new Random();
List<FinancialStuff> financialStuffList = new List<FinancialStuff>();
financialStuffList.Add(new FinancialStuff() { Name = "MSFT", Amount = rand.Next(, ) });
financialStuffList.Add(new FinancialStuff() { Name = "AAPL", Amount = rand.Next(, ) });
financialStuffList.Add(new FinancialStuff() { Name = "GOOG", Amount = rand.Next(, ) });
financialStuffList.Add(new FinancialStuff() { Name = "BBRY", Amount = rand.Next(, ) });
(PieChart.Series[] as PieSeries).ItemsSource = financialStuffList;
(ColumnChart.Series[] as ColumnSeries).ItemsSource = financialStuffList;
(LineChart.Series[] as LineSeries).ItemsSource = financialStuffList;
(BarChart.Series[] as BarSeries).ItemsSource = financialStuffList;
(BubbleChart.Series[] as BubbleSeries).ItemsSource = financialStuffList;
}
也可以先将Series弄出来:
public static LineSeries InitChart(List<FinancialStuff> financialStuffList)
{
LineSeries lSeries = new LineSeries();
lSeries.IndependentValuePath = "Name";
lSeries.DependentValuePath = "Amount"; lSeries.ItemsSource = financialStuffList; return lSeries;
}
LineSeries ls = Functions.WinrtChartHelper.InitChart(financialStuffList);
this.LineChart.Series.Add(ls);
然而,这样子只能实现LineSeries ,PieSeries/ColumnSeries/BarSeries/BubbleSeries等都会有一个UnhandledException出现……
WinRTXamlToolkit在Win8.1实现统计图的更多相关文章
- Windows.Andy.Code4App.dll Win8.1/WP8.1通用类库@ver1.0.0
直接入题! Win8.1和WP8.1眼下已经渐渐融为一体,WP8.1不断向Win8.1靠拢,虽然一些方法上WP8.1和Win8.1不同(ps:WP8.1和Win8.1的不同之处),但大部分还是相同的. ...
- 0.Win8.1,Win10,Windows Server 2012 安装 Net Framework 3.5
后期会在博客首发更新:http://dnt.dkill.net 网站部署之~Windows Server | 本地部署:http://www.cnblogs.com/dunitian/p/482280 ...
- win8.1硬盘安装ubuntu14.04双系统
在网上找了很多方法都失败了,原因是大多数方法都是用mbr方式安装的,如grub4dos,easybcd.以至于连自己都怀疑win8能不能用硬盘安装,差点就去买个u盘来安装了,就在打算放弃的时候在ubu ...
- alienware Win8 系统安装
原作者网名 alienware-小来: 我的外星人 老是装系统出错.我觉得写的不错.把原作者的东西拿过来.. 对于win7系统的用户来说想要体验下win8.1系统,或者是原来win8.1系统加装固态后 ...
- win8改win7笔记
内存<=4G,选32位(×86) 内存>=4G,选64位(×64) (非必须) BIOS设置 USB Boot Support Disabled改为Enabled(如 ...
- 【转】微软教学:三种方法屏蔽Win7/Win8.1升级Win10推送
原文地址:http://www.ithome.com/html/win10/199961.htm 微软在2015年6月就开启了Win10升级推送工作,主要是靠<获取Windows10>工具 ...
- 教你一招:解决win10/win8.1系统在安装、卸载软件时出现2502、2503错误代码的问题
经常遇到win10/win8.1系统在安装.卸载软件时出现2502.2503错误代码的问题. 解决办法: 1.打开任务管理器后,切换到“详细信息”选项卡,找到explore.exe这个进程,然后结束进 ...
- 【转】windows环境下安装win8.1+Mac OS X 10.10双系统教程
先要感谢远景论坛里的各位大神们的帖子 没有他们的分享我也不能顺利的装上Mac OS X 10.10! 写这篇随笔主要是为了防止自己遗忘,同时给大家分享下我的经验. 本教程适用于BIOS+MBR分区的 ...
- 【转】[教程]在 win7 / win8 下安装苹果系统 (懒人版)
前言 这篇安装教程的素材在国庆就准备好了,但那时学习任务比较重,没有时间发帖,一直拖到现在.趁这个周末有空,赶紧写完它,希望能帮助一些景友. 论坛已经有不少安装教程,如果对这篇安装教程有疑问可以去 ...
随机推荐
- luogu1197 [JSOI2008]星球大战
题目大意 有一个无向图,每次删除一个节点,求删除后图中连通块的个数.(如果两个星球可以通过现存的以太通道直接或间接地连通,则这两个星球在同一个连通块中) 题解 连通块?用并查集可以找到一个连通块,但是 ...
- dp状态压缩
dp状态压缩 动态规划本来就很抽象,状态的设定和状态的转移都不好把握,而状态压缩的动态规划解决的就是那种状态很多,不容易用一般的方法表示的动态规划问题,这个就更加的难于把握了.难点在于以下几个方面:状 ...
- aspectC++常用命令
常用命令:1.ag++ main.cc //在工程目录下产生编译后的exe2.ag++ main.cc --weave_only //产生.acc 纯c++文件3.ag++ main.cc --gen ...
- idea导入ssm项目启动tomcat报错404
用idea写ssm项目,基于之前一直在用spring boot 对于idea如何运行ssm花费了一番功夫 启动Tom act一直在报404 我搜了网上各种解决办法都不行,花费一天多的时间解决不了 就 ...
- 用xftp从win7系统传输一些必要的文件到Linux
新建会话,主机名为Linux系统的ip地址,选用SFTP协议,选用UTF-8编码格式 1.安装JDK 切换到java路径下 卸载openJDK: 用rpm -qa |grep java指令查看 用rp ...
- 团队作业-Beta版本发布
这个作业属于哪个课程 <课程的链接> 这个作业要求在哪里 <作业要求的链接> 团队名称 Three cobblers 这个作业的目标 Beta版本发布报 ...
- 【PostgreSQL-9.6.3】修改监听的IP和端口
在数据目录下编辑postgresql.conf文件,我的数据目录是/usr/local/pgsql/data vi postgresql.conf 找到如下内容: ... #listen_addres ...
- QS之force(1)
force This command allows you to apply stimulus interactively to VHDL signals(not variables), Verilo ...
- I2C controller core之Bit controller(03)
FPGA proven, AISC proven, I2C controller core from OpenCores http://opencores.org/project,i2c Bit-co ...
- Caffe: gflag编译出现问题汇总
1. 使用Unicode字符集: 出现问题 E:\CodeBase\ML\Caffe\ThirdPartySrc\gflags-master\src\gflags.cc(1340): error C2 ...