visifire的应用

先来看一下visifire的英文介绍吧

 

 

Visifire is a set of data visualization components - powered by Microsoft Silverlight & WPF. Visifire is a multi-targeting control which can be used in both WPF & Silverlight applications. Using the same API, charts / gauges in Mobile, Web and Desktop environments can be created within minutes. It can also be embedded in any web page as a standalone Silverlight App. Visifire is independent of server side technology. It can be used with ASP, ASP.Net, PHP, JSP, ColdFusion, Python, Ruby or just simple HTML. Don't take our word for it! Visit Visifire Gallery or design your own chart or gauge using Designer.

 

 

一长串的英文,无非就说明了visifire是一组数据的可视化表现,也就是图标表现形式。所以用visifire可以有效,靓丽的采用图形化的方式来表现数据。它作为一个组件,可以用在很多技术和语言上面,如SP, ASP.Net, PHP, JSP, ColdFusion, Python, Ruby ,甚至是简单的 HTML。所以visifire用起来很方便,很广泛

 

下面在html中举一个例子

 

代码如下

 

<mce:script type="text/javascript" src="visifire/Visifire.js" mce_src="visifire/Visifire.js"></mce:script> <div id="VisifireChart0" > <mce:script type="text/javascript"><!-- // Create Visifire object var vChart = new Visifire('visifire/SL.Visifire.Charts.xap', "MyChart", 650, 500); // vChart1.setLogLevel(0); // If you want to disable logging. // Chart Style XML var styleXml = '<Canvas.Resources>' + ' <Style x:Key="TitleStyle" TargetType="vc:Title">' + ' <Setter Property="FontColor" Value="Red"></Setter>' + ' </Style>' + ' <Style x:Key="ChartStyle" TargetType="vc:Chart">' + ' <Setter Property="Background" Value="#dbdbdb"></Setter>' + ' <Setter Property="Bevel" Value="True"></Setter>' + ' <Setter Property="BorderBrush" Value="Black"></Setter>' + ' </Style>' + '</Canvas.Resources>'; // Chart XML var chartXml = styleXml + '<vc:Chart Style="{StaticResource ChartStyle}" mce_Style="{StaticResource ChartStyle}" xmlns:vc="clr-namespace:Visifire.Charts;assembly=SLVisifire.Charts" Width="650" Height="500" Theme="Theme1" AnimationEnabled="True" BorderThickness="2" View3D="False">' + ' <vc:Chart.Titles>' + ' <vc:Title Style="{StaticResource TitleStyle}" mce_Style="{StaticResource TitleStyle}" Text="周销量图" FontSize="14"/>' + ' </vc:Chart.Titles>' + ' <vc:Chart.Series>' + ' <vc:DataSeries RenderAs="Line" LegendText="菜品一" LabelEnabled="True">' + ' <vc:DataSeries.DataPoints>' + ' <vc:DataPoint AxisXLabel="星期一" YValue="3"/>' + ' <vc:DataPoint AxisXLabel="星期二" YValue="28"/>' + ' <vc:DataPoint AxisXLabel="星期三" YValue="27"/>' + ' <vc:DataPoint AxisXLabel="星期四" YValue="17.9"/>' + ' <vc:DataPoint AxisXLabel="星期五" YValue="20"/>' + ' </vc:DataSeries.DataPoints>' + ' </vc:DataSeries>' + ' <vc:DataSeries RenderAs="Line" LegendText="菜品二" LabelEnabled="True">' + ' <vc:DataSeries.DataPoints>' + ' <vc:DataPoint AxisXLabel="星期一" YValue="40"/>' + ' <vc:DataPoint AxisXLabel="星期二" YValue="25"/>' + ' <vc:DataPoint AxisXLabel="星期三" YValue="23"/>' + ' <vc:DataPoint AxisXLabel="星期四" YValue="27"/>' + ' <vc:DataPoint AxisXLabel="星期五" YValue="29"/>' + ' </vc:DataSeries.DataPoints>' + ' </vc:DataSeries>' + ' <vc:DataSeries RenderAs="Line" LegendText="菜品三" LabelEnabled="True">' + ' <vc:DataSeries.DataPoints>' + ' <vc:DataPoint AxisXLabel="星期一" YValue="30"/>' + ' <vc:DataPoint AxisXLabel="星期二" YValue="18"/>' + ' <vc:DataPoint AxisXLabel="星期三" YValue="37"/>' + ' <vc:DataPoint AxisXLabel="星期四" YValue="27"/>' + ' <vc:DataPoint AxisXLabel="星期五" YValue="21"/>' + ' </vc:DataSeries.DataPoints>' + ' </vc:DataSeries>' + ' <vc:DataSeries RenderAs="Line" LegendText="菜品四" LabelEnabled="True">' + ' <vc:DataSeries.DataPoints>' + ' <vc:DataPoint AxisXLabel="星期一" YValue="30"/>' + ' <vc:DataPoint AxisXLabel="星期二" YValue="18"/>' + ' <vc:DataPoint AxisXLabel="星期三" YValue="37"/>' + ' <vc:DataPoint AxisXLabel="星期四" YValue="27"/>' + ' <vc:DataPoint AxisXLabel="星期五" YValue="21"/>' + ' </vc:DataSeries.DataPoints>' + ' </vc:DataSeries>' + ' <vc:DataSeries RenderAs="Line" LegendText="菜品五" LabelEnabled="True">' + ' <vc:DataSeries.DataPoints>' + ' <vc:DataPoint AxisXLabel="星期一" YValue="90"/>' + ' <vc:DataPoint AxisXLabel="星期二" YValue="65"/>' + ' <vc:DataPoint AxisXLabel="星期三" YValue="55"/>' + ' <vc:DataPoint AxisXLabel="星期四" YValue="37"/>' + ' <vc:DataPoint AxisXLabel="星期五" YValue="29"/>' + ' </vc:DataSeries.DataPoints>' + ' </vc:DataSeries>' + ' <vc:DataSeries RenderAs="Line" LegendText="菜品六" LabelEnabled="True">' + ' <vc:DataSeries.DataPoints>' + ' <vc:DataPoint AxisXLabel="星期一" YValue="38"/>' + ' <vc:DataPoint AxisXLabel="星期二" YValue="88"/>' + ' <vc:DataPoint AxisXLabel="星期三" YValue="47"/>' + ' <vc:DataPoint AxisXLabel="星期四" YValue="67"/>' + ' <vc:DataPoint AxisXLabel="星期五" YValue="25"/>' + ' </vc:DataSeries.DataPoints>' + ' </vc:DataSeries>' + ' </vc:Chart.Series>' + ' </vc:Chart>'; // Set Chart XML vChart.setDataXml(chartXml); // Render chart vChart.render("VisifireChart0"); // --></mce:script> </div> 

 

相信这段代码很容易看懂吧,要注意的有两点

(一) 必须引入 visifire.js文件

(二)注意id="VisifireChart0"和"vChart.render("VisifireChart0");"的对应关系,其他的就是标准的visifire的配置了

 

效果图如下

 

visifire的应用_第1张图片

 

呵呵,是不是很简单。图表很炫吧,尽情的用吧!

 

备注:若你的图表上显示“You need Microsoft Silverlight to view Visifire Charts.

You can install it by clicking on this link.

Please restart the browser after installation.”,那么你就装一个Silverlight吧

 

 

想了解更多关于visifire的信息,请访问 http://www.visifire.com/

你可能感兴趣的:(Microsoft,asp.net,silverlight,setter,ColdFusion,Visualization)