vistifire --windows phone7 数据可视化控件简要介绍(翻译)
涉及技术:silverlight4,silverlight,visual studio 2010 ,windows phone7
讨论主题:控件,动画,数据绑定,silverlight,用户接口,MVVM模式,手机应用开发,图标
简要介绍:
这个应用程序展现经常在window phone7手机中常用的图表和压力仪表控件,应用使用Visifre来绘制各种样式的图标和压力仪表。
一些实例的展示
1,放大图表
2,大量的数据点来绘制图标
3, 仪表
4,实时更新数据
5,.......
准备工作:
去网站http://code.msdn.microsoft.com/Using-Charts-Gauges-in-WP7-a25c6958下载源码
双击VisifireWPSamples.sln文件,在visual studio2010 中打开项目,然后可以在模拟机或已连接上电脑的同步的
window phone7手机上运行。
源代码简要说明:
所有的样品(图表/仪表)在项目源文件中储存为xaml文件,当在Pivot中的样品图片被点击时,程序将在Panorama Contorl控件
中绘制与样品图片类型像似的多种图表。看到程序的运行结果,你也许就想创建你的第一个类型的程序。
一小段程序的中代码
从运行结果来看是一个简单的二维统计表
<my:SampleBasePage
x:Class="Visifire.Samples.WP.Samples.GallerySamples.Column2D.Column2D1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
FontFamily="{StaticResource PhoneFontFamilyNormal}"
FontSize="{StaticResource PhoneFontSizeNormal}"
Foreground="{StaticResource PhoneForegroundBrush}"
SupportedOrientations="Portrait" Orientation="Portrait"
mc:Ignorable="d" d:DesignHeight="768" d:DesignWidth="480"
shell:SystemTray.IsVisible="True"
xmlns:my="clr-namespace:Visifire.Samples.WP.Samples;assembly=VisifireWPSamples">
<Grid x:Name="LayoutRoot" Background="Transparent" Margin="0,0,0,10">
<vc:Chart xmlns:vc="clr-namespace:Visifire.Charts;assembly=SLWpVisifire.Charts"
BorderThickness="0" Theme="Theme1" Background="Black" LightingEnabled="False">
//表名
<vc:Chart.Titles>
<vc:Title Text="Athens 2004 Olympics" FontFamily="Arial"/>
</vc:Chart.Titles>
//x轴信息
<vc:Chart.AxesX>
<vc:Axis Title="Country">
<vc:Axis.AxisLabels>
<vc:AxisLabels Interval="1"/>
</vc:Axis.AxisLabels>
</vc:Axis>
</vc:Chart.AxesX>
//y轴信息
<vc:Chart.AxesY>
<vc:Axis AxisMinimum="0" AxisMaximum="60" Title="Gold Medals Won"/>
</vc:Chart.AxesY>
//呈现的信息
<vc:Chart.Series>
<vc:DataSeries RenderAs="Column" LabelEnabled="True">
<vc:DataSeries.DataPoints>
<vc:DataPoint AxisXLabel="USA" YValue="50"/>
<vc:DataPoint AxisXLabel="China" YValue="35"/>
<vc:DataPoint AxisXLabel="Russia" YValue="27"/>
<vc:DataPoint AxisXLabel="Australia" YValue="17"/>
<vc:DataPoint AxisXLabel="Japan" YValue="16"/>
</vc:DataSeries.DataPoints>
</vc:DataSeries>
</vc:Chart.Series>
</vc:Chart>
</Grid>
</my:SampleBasePage>
隐藏代码:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.Phone.Controls;
using Visifire.Charts;
namespace Visifire.Samples.WP.Samples.GallerySamples.Column2D
{
public partial class Column2D1 : SampleBasePage
{
public Column2D1()
{
InitializeComponent();
}
}
关于vistifire
vistifire是一个数据可视化控件.可以在ASP,ASP.NET,桌面程序。SharePoint,wpf,PHP,JSP,ColdFusion,Python,Ruby使用。

浙公网安备 33010602011771号