【注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实现统计图的更多相关文章

  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的不同之处),但大部分还是相同的. ...

  2. 0.Win8.1,Win10,Windows Server 2012 安装 Net Framework 3.5

    后期会在博客首发更新:http://dnt.dkill.net 网站部署之~Windows Server | 本地部署:http://www.cnblogs.com/dunitian/p/482280 ...

  3. win8.1硬盘安装ubuntu14.04双系统

    在网上找了很多方法都失败了,原因是大多数方法都是用mbr方式安装的,如grub4dos,easybcd.以至于连自己都怀疑win8能不能用硬盘安装,差点就去买个u盘来安装了,就在打算放弃的时候在ubu ...

  4. alienware Win8 系统安装

    原作者网名 alienware-小来: 我的外星人 老是装系统出错.我觉得写的不错.把原作者的东西拿过来.. 对于win7系统的用户来说想要体验下win8.1系统,或者是原来win8.1系统加装固态后 ...

  5. win8改win7笔记

    内存<=4G,选32位(×86)   内存>=4G,选64位(×64)   (非必须) BIOS设置    USB Boot Support     Disabled改为Enabled(如 ...

  6. 【转】微软教学:三种方法屏蔽Win7/Win8.1升级Win10推送

    原文地址:http://www.ithome.com/html/win10/199961.htm 微软在2015年6月就开启了Win10升级推送工作,主要是靠<获取Windows10>工具 ...

  7. 教你一招:解决win10/win8.1系统在安装、卸载软件时出现2502、2503错误代码的问题

    经常遇到win10/win8.1系统在安装.卸载软件时出现2502.2503错误代码的问题. 解决办法: 1.打开任务管理器后,切换到“详细信息”选项卡,找到explore.exe这个进程,然后结束进 ...

  8. 【转】windows环境下安装win8.1+Mac OS X 10.10双系统教程

    先要感谢远景论坛里的各位大神们的帖子  没有他们的分享我也不能顺利的装上Mac OS X 10.10! 写这篇随笔主要是为了防止自己遗忘,同时给大家分享下我的经验. 本教程适用于BIOS+MBR分区的 ...

  9. 【转】[教程]在 win7 / win8 下安装苹果系统 (懒人版)

    前言   这篇安装教程的素材在国庆就准备好了,但那时学习任务比较重,没有时间发帖,一直拖到现在.趁这个周末有空,赶紧写完它,希望能帮助一些景友. 论坛已经有不少安装教程,如果对这篇安装教程有疑问可以去 ...

随机推荐

  1. 更改printk打印级别【转】

    本文转载自:http://blog.csdn.net/weed_hz/article/details/8949140 1.查看当前控制台的打印级别 cat /proc/sys/kernel/print ...

  2. 10 Future Web Trends 十大未来互联网趋势

    转载自:http://blog.sina.com.cn/s/blog_4be577310100ajpb.html 我们很满意自己进入的当前网络纪元,通常被称为Web 2.0.这个阶段互联网的特征包括搜 ...

  3. js实用篇之数组、字符串常用方法

    常常在开发中,会使用到很多js数组和字符串的处理方法,这里列举一些我常用到的一些,方便大家参考使用. 数组方面 push:向数组尾部增加内容,返回的是新数组的长度. var arr = [1,2,3] ...

  4. [Apple开发者帐户帮助]六、配置应用服务(2)创建DeviceCheck私钥

    要验证与DeviceCheck服务的通信,您将使用启用了DeviceCheck的私钥. 首先创建并下载启用了DeviceCheck 的私钥.然后获取密钥标识符(kid)以创建JSON Web令牌(JW ...

  5. Python可迭代序列排序总结

    列表排序 示例:lst = [12, 6, 1, 3, 10] 方法一:使用sort def list_sort(lst): lst.sort() # 就地排序,没有返回值 return lst 补充 ...

  6. go的接口

    一.接口定义 接口类型 在讲基础数据类型时,我们曾提了一下 interface 数据类型,这个数据类型就是接口类型 什么是接口 Go 语言不是"传统"的面向对象的编程语言:它里面没 ...

  7. 修改CAS源码是的基于DB的认证方式配置更灵活

    最近在做CAS配置的时候,遇到了数据源不提供密码等数据的情况下,怎样实现密码输入认证呢? 第一步:新建Java项目,根据假面算法生成CAS加密工具 出于保密需要不提供自定义的加密工具,在您的实际项目中 ...

  8. JavaScript 进阶 常用内置对象

    一.常用内置对象 所谓内置对象就是ECMAscript提供出来的一些对象,我们知道对象都是有相应的属性和方法 数组Arry 1.数组的创建方式 字面量方式创建(推荐使用,简单粗暴) var color ...

  9. spring注解、aop(二)

    使用注解配置spring 1.导入 spring-aop-5.0.6.RELEASE.jar包 2.为主配置文件引入新的命名空间 xmlns:context="http://www.spri ...

  10. 文件的上传(可以上传照片,word文档,等单个文件)

    jsp: jsp页面: <LINK href="${basePath}plugins/uploadify/uploadify.css" type="text/css ...