<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Visifire &#187; Tutorials and Samples</title>
	<atom:link href="http://www.visifire.com/blog/category/tutorials-and-samples/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.visifire.com/blog</link>
	<description>Fire up your imagination</description>
	<lastBuildDate>Wed, 25 Jan 2012 13:13:23 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.4</generator>
		<item>
		<title>Fast Silverlight Charts</title>
		<link>http://www.visifire.com/blog/2011/12/02/fast-silverlight-charts/</link>
		<comments>http://www.visifire.com/blog/2011/12/02/fast-silverlight-charts/#comments</comments>
		<pubDate>Fri, 02 Dec 2011 19:46:43 +0000</pubDate>
		<dc:creator>Chirag</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[Tutorials and Samples]]></category>

		<guid isPermaLink="false">http://www.visifire.com/blog/?p=2225</guid>
		<description><![CDATA[Hi, You know that we are working on optimizing the performance of charts. I am happy to share that we are done optimizing the overall performance of the charts &#8211; QuickLine chart to start with. Both initial render (drawing chart for the first time) &#38; real-time render (updating chart in real-time) are now blazing fast. With these [...]]]></description>
			<content:encoded><![CDATA[<p>Hi,</p>
<p>You know that we are working on <a href="http://www.visifire.com/blog/2011/10/20/performance-optimised-initial-render-now-2x-faster/">optimizing the performance of charts</a>. I am happy to share that we are done optimizing the overall performance of the charts &#8211; QuickLine chart to start with. Both initial render (drawing chart for the first time) &amp; real-time render (updating chart in real-time) are now blazing fast. With these changes, Visifire is one of the fastest Silverlight charts! This blog contains benchmark figures &amp; samples to corroborate our claim.</p>
<p>You’d feel the need of faster charts only when there is high number of datapoints. For less datapoints any charting component would suffice. Time taken by a component to plot datapoints on a chart for the first time (initial render) is a key metric to decide the performance. We did a small exercise to calculate the number of datapoints a charting component could draw in one second. For comparison we are using Visiblox, a fairly quick chart from Scott Logic. We supplied 10,000 through 50,000 datapoints to both charting components. We repeated the exercise to get 10 sample figures. Later, took an average to find out the number of datapoints that could be drawn in a second. Visifire could draw anywhere between 14,500 to 13,200 datapoints in a second. Whereas Visiblox could draw a maximum of 6,800 datapoints &amp; the performance degraded drastically as the datapoints increased. Below are the benchmark figures:</p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-2327" style="border: 0pt none;" title="Charting performance comparison of Visifire and Visiblox" src="http://www.visifire.com/blog/wp-content/uploads/2011/12/SampleChart3.jpg" alt="Visifire, Visiblox - Charting Performance Comparison" width="504" height="305" /></p>
<p>Note: More the datapoints per second, faster the chart.</p>
<p>Embedded below is the application used to calculate the benchmark figures. You can play around with it &amp; decide who is fast!</p>
<table style="height: 38px;" width="733">
<tbody>
<tr>
<td><div id="silverlightControlHost"><object data="data:application/x-silverlight," type="application/x-silverlight-2" width="322" height="400"><param name="source" value="http://www.visifire.com/blog/wp-content/post_xaps/VisifireInitialRenderTest.xap?v=13"/><param name="background" value="white" /><a href="http://go.microsoft.com/fwlink/?LinkID=108182" style="text-decoration: none;"><img src="http://go.microsoft.com/fwlink/?LinkId=108181" alt="Get Microsoft Silverlight" style="border-style: none"/></a></object><iframe style='visibility:hidden;height:0;width:0;border:0px'></iframe></div><br /></td>
<td><div id="silverlightControlHost"><object data="data:application/x-silverlight," type="application/x-silverlight-2" width="322" height="400"><param name="source" value="http://www.visifire.com/blog/wp-content/post_xaps/VisibloxInitialRenderTest.xap?v=13"/><param name="background" value="white" /><a href="http://go.microsoft.com/fwlink/?LinkID=108182" style="text-decoration: none;"><img src="http://go.microsoft.com/fwlink/?LinkId=108181" alt="Get Microsoft Silverlight" style="border-style: none"/></a></object><iframe style='visibility:hidden;height:0;width:0;border:0px'></iframe></div><br /></td>
</tr>
</tbody>
</table>
<p>Note: Lesser the time taken, faster the chart.</p>
<p>Measuring framerate is a good way of finding the real-time rendering performance of a chart. We have just borrowed some samples from <a href="http://www.scottlogic.co.uk/blog/colin/2010/12/visiblox-visifire-dynamicdatadisplay-charting-performance-comparison/">Visiblox post</a>. You can play around with the following sample &amp; decide who is fast!</p>
<table width="733">
<tbody>
<tr>
<td style="text-align: center;"><div id="silverlightControlHost"><object data="data:application/x-silverlight," type="application/x-silverlight-2" width="345" height="450"><param name="source" value="http://www.visifire.com/blog/wp-content/post_xaps/Visifire.Charts.Examples.xap?v=13"/><param name="background" value="white" /><a href="http://go.microsoft.com/fwlink/?LinkID=108182" style="text-decoration: none;"><img src="http://go.microsoft.com/fwlink/?LinkId=108181" alt="Get Microsoft Silverlight" style="border-style: none"/></a></object><iframe style='visibility:hidden;height:0;width:0;border:0px'></iframe></div><br /></td>
<td><div id="silverlightControlHost"><object data="data:application/x-silverlight," type="application/x-silverlight-2" width="345" height="450"><param name="source" value="http://www.visifire.com/blog/wp-content/post_xaps/Visiblox.Charts.Examples.xap?v=13"/><param name="background" value="white" /><a href="http://go.microsoft.com/fwlink/?LinkID=108182" style="text-decoration: none;"><img src="http://go.microsoft.com/fwlink/?LinkId=108181" alt="Get Microsoft Silverlight" style="border-style: none"/></a></object><iframe style='visibility:hidden;height:0;width:0;border:0px'></iframe></div><br /></td>
</tr>
</tbody>
</table>
<p>Note: More the frames per second, faster the chart.</p>
<p>The source code of the above samples is available in these archives [<a href="http://www.visifire.com/downloads/samples/blog/initial-render-comparison.zip">sample1</a>, <a href="http://www.visifire.com/downloads/samples/blog/real-time-render-comparison.zip">sample2</a>] for you to verify. The samples don&#8217;t contain charting libraries &amp; are to be downloaded separately. Feel free to comment on this exercise.</p>
<p>Cheers,<br />
Chirag<br />
Team Visifire<br />
Fire up your imagination!</p>
<div style="float: left; margin-right: 10px; margin-top: 3px;"><a href="http://twitter.com/share" class="twitter-share-button" data-text="Fast Silverlight Charts" data-via="visifire" data-url="http://www.visifire.com/blog/2011/12/02/fast-silverlight-charts/" data-count="none" data-via="visifire" data-related=":">Tweet</a></div>]]></content:encoded>
			<wfw:commentRss>http://www.visifire.com/blog/2011/12/02/fast-silverlight-charts/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>SharePoint Charts</title>
		<link>http://www.visifire.com/blog/2011/11/02/sharepoint-charts/</link>
		<comments>http://www.visifire.com/blog/2011/11/02/sharepoint-charts/#comments</comments>
		<pubDate>Wed, 02 Nov 2011 15:12:27 +0000</pubDate>
		<dc:creator>Chirag</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[Releases]]></category>
		<category><![CDATA[Tutorials and Samples]]></category>

		<guid isPermaLink="false">http://www.visifire.com/blog/?p=2067</guid>
		<description><![CDATA[We are delighted to launch our brand new product &#8211; Visifire for SharePoint (VfS). You were able to use Visifire in SharePoint in a rather cumbersome way. Creating charts in SharePoint has never been easier. Visifire for SharePoint is a wizard driven solution to create charts in SharePoint without writing any code! Embedded below is [...]]]></description>
			<content:encoded><![CDATA[<p>We are delighted to launch our brand new product &#8211; Visifire for SharePoint (VfS). You were able to use Visifire in SharePoint in a rather <a href="http://www.visifire.com/documentation/Visifire_Documentation/Charts/Quick_Start/SharePoint/Working_With_SharePoint_List_And_Visifire_Chart.htm">cumbersome way</a>. Creating charts in SharePoint has never been easier. Visifire for SharePoint is a wizard driven solution to create charts in SharePoint without writing any code! Embedded below is a short video on creating chart in SharePoint in just few clicks.</p>
<p><iframe width="640" height="360" src="http://www.youtube.com/embed/mSxAajlUnt4?hd=1" frameborder="0" allowfullscreen></iframe></p>
<p>Before I conclude, summarized below are the key features of &#8220;Visifire for SharePoint&#8221;</p>
<ul>
<li>Create charts in just few clicks</li>
<li>No need to write any code</li>
<li>Full fledged Chart Designer to customize default chart</li>
<li>Chart Designer boasts slick UI</li>
<li>Easy to deploy</li>
<li>Works with Microsoft SharePoint 2007 &amp; 2010 on Windows Server 2003/2008</li>
<li>Connects to SharePoint Lists</li>
<li>Wide range of 2D/3D chart types</li>
</ul>
<p>Starts at an <a href="http://visifire.com/license.php">introductory price of $999 per server</a>. Download a <a href="http://www.visifire.com/download_silverlight_wpf_controls.php">30 day Trial here</a>. </p>
<p>We are very excited about this release &amp; would love to have your feedback.</p>
<p>Cheers,<br />
Chirag<br />
Team Visifire</p>
<div style="float: left; margin-right: 10px; margin-top: 3px;"><a href="http://twitter.com/share" class="twitter-share-button" data-text="SharePoint Charts" data-via="visifire" data-url="http://www.visifire.com/blog/2011/11/02/sharepoint-charts/" data-count="none" data-via="visifire" data-related=":">Tweet</a></div>]]></content:encoded>
			<wfw:commentRss>http://www.visifire.com/blog/2011/11/02/sharepoint-charts/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>WP7 (Windows Phone 7) App for Visifire</title>
		<link>http://www.visifire.com/blog/2011/07/20/wp7-windows-phone-7-app-for-visifire/</link>
		<comments>http://www.visifire.com/blog/2011/07/20/wp7-windows-phone-7-app-for-visifire/#comments</comments>
		<pubDate>Wed, 20 Jul 2011 11:25:47 +0000</pubDate>
		<dc:creator>Chirag</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[Tutorials and Samples]]></category>

		<guid isPermaLink="false">http://www.visifire.com/blog/?p=1924</guid>
		<description><![CDATA[Hi, We are delighted to release a WP7 App to showcase Visifire charts &#38; gauges. As you already know Visifire supports WP7. This App is to let you quickly try how Visifire controls run on WP7. Click here to download the App. Embedded below is a video tour of the App. We are excited about [...]]]></description>
			<content:encoded><![CDATA[<p>Hi,</p>
<p>We are delighted to release a WP7 App to showcase Visifire charts &amp; gauges. As you already know Visifire supports WP7. This App is to let you quickly try how Visifire controls run on WP7. <a href="http://www.visifire.com/downloads/samples/example_area/visifire-wp-samples.zip">Click here to download the App</a>. Embedded below is a video tour of the App.</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="640" height="390" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/AMKvpCg1_Kg?version=3&amp;hl=en_GB&amp;hd=1" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="640" height="390" src="http://www.youtube.com/v/AMKvpCg1_Kg?version=3&amp;hl=en_GB&amp;hd=1" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p>We are excited about this App. Please give it a spin &amp; let us know your feedback.</p>
<p>Cheers,<br />
Team Visifire</p>
<div style="float: left; margin-right: 10px; margin-top: 3px;"><a href="http://twitter.com/share" class="twitter-share-button" data-text="WP7 (Windows Phone 7) App for Visifire" data-via="visifire" data-url="http://www.visifire.com/blog/2011/07/20/wp7-windows-phone-7-app-for-visifire/" data-count="none" data-via="visifire" data-related=":">Tweet</a></div>]]></content:encoded>
			<wfw:commentRss>http://www.visifire.com/blog/2011/07/20/wp7-windows-phone-7-app-for-visifire/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Silverlight and WPF Enterprise Dashboard</title>
		<link>http://www.visifire.com/blog/2011/04/08/silverlight-and-wpf-enterprise-dashboard/</link>
		<comments>http://www.visifire.com/blog/2011/04/08/silverlight-and-wpf-enterprise-dashboard/#comments</comments>
		<pubDate>Fri, 08 Apr 2011 15:29:55 +0000</pubDate>
		<dc:creator>somnath</dc:creator>
				<category><![CDATA[Creative Use of Visifire]]></category>
		<category><![CDATA[Tutorials and Samples]]></category>

		<guid isPermaLink="false">http://www.visifire.com/blog/?p=1760</guid>
		<description><![CDATA[Enterprise dashboards provide rich data visualization for analyzing data. A dashboard &#8211; for eg. sales dashboard is a vital tool for C-level executives, business managers and sales persons. This sales dashboard is a demo application using rich set of Visifire controls to analyze product wise monthly revenue of a fictitious company. It also shows sales conversion ratio [...]]]></description>
			<content:encoded><![CDATA[<p>Enterprise dashboards provide rich data visualization for analyzing data. A dashboard &#8211; for eg. sales dashboard is a vital tool for C-level executives, business managers and sales persons. This sales dashboard is a demo application using rich set of Visifire controls to analyze product wise monthly revenue of a fictitious company. It also shows sales conversion ratio showing how successful the sales team is in converting the leads to sales. Based on several parameters shown in the dashboard the decision makers can make informed decisions. </p>
<p><a href="http://visifire.com/samples/SalesDashboard/silverlight_samples_sales_dashboard.html"><img class="size-full wp-image-1810 alignnone" title="visifire_sales_dashboard" src="http://www.visifire.com/blog/wp-content/uploads/2011/04/visifire_sales_dashboard11.jpg" alt="" width="679" height="449" /></a></p>
<p style="text-align: justify;">This dashboard application is built based on MVVM pattern and best practices. MVVM follows three basic blocks called Model, View and ViewModel. The figure below shows basic blocks of the dashboard application.</p>
<p style="text-align: center;"><img class="alignnone size-full wp-image-1771" title="mvvm_visifire_sales_dashboard" src="http://www.visifire.com/blog/wp-content/uploads/2011/04/mvvm_visifire_sales_dashboard.jpg" alt="" width="660" height="400" /></p>
<p><strong>Model:</strong> The Model is also called DataModel which contains business objects and model classes. It is independent of the View(UI).</p>
<p><strong>View:</strong> The View contains visual elements displayed to the user and allows the user to interact with it.</p>
<p><strong>ViewModel</strong>: The ViewModel represents the “Model of the View” which is also a mediator between View and the Model. It exposes the model’s data that is needed by the View.</p>
<p style="text-align: justify;">In this Sales dashboard, the model represents business objects which include Model classes (Order and SalesConversion classes). View mainly represents user interface (XAML) and handles user interaction. “ProductWiseSalesView” contains chart controls to display product wise monthly revenue distribution, sales in volumes like sales conversion ratio, number of licenses sold with or without support and new licenses vs upgrades. The “ProductWiseSalesView” also contains two Gauge controls which displays annual revenue for a particular product. User interacts with the View. Content of the View is handled in the ViewModel through binding. The binding between View and ViewModel is done by setting ViewModel as the DataContext of the View. The ViewModel is derived from ModelBase class which in turn implements INotifyPropertyChanged interface to support DataBinding. Hence when ViewModel properties are changed, new changes are automatically reflected in the View.</p>
<p>Click <a href="http://www.visifire.com/samples/SalesDashboard/silverlight_samples_sales_dashboard.html">here</a> to view the dashboard.</p>
<p>You can download the source code from <a href="http://visifire.com/silverlight_examples_details.php?id=22">here</a>.</p>
<p>Cheers,<br />
Team Visifire</p>
<div style="float: left; margin-right: 10px; margin-top: 3px;"><a href="http://twitter.com/share" class="twitter-share-button" data-text="Silverlight and WPF Enterprise Dashboard" data-via="visifire" data-url="http://www.visifire.com/blog/2011/04/08/silverlight-and-wpf-enterprise-dashboard/" data-count="none" data-via="visifire" data-related=":">Tweet</a></div>]]></content:encoded>
			<wfw:commentRss>http://www.visifire.com/blog/2011/04/08/silverlight-and-wpf-enterprise-dashboard/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Windows Phone 7 Charts</title>
		<link>http://www.visifire.com/blog/2010/07/19/windows-phone-7-charts/</link>
		<comments>http://www.visifire.com/blog/2010/07/19/windows-phone-7-charts/#comments</comments>
		<pubDate>Mon, 19 Jul 2010 16:20:28 +0000</pubDate>
		<dc:creator>Chirag</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[Releases]]></category>
		<category><![CDATA[Tutorials and Samples]]></category>

		<guid isPermaLink="false">http://www.visifire.com/blog/?p=1338</guid>
		<description><![CDATA[Hi, You folks know that Windows Phone 7 Charts are possible with Visifire. Due to some breaking changes in the latest Beta release of Windows Phone Developer Tools users had issues using Visifire. We have decided to ship separate binaries for WP7 users. All that changes is that one has to provide reference to SLWpVisifire.Charts.dll [...]]]></description>
			<content:encoded><![CDATA[<p>Hi,</p>
<p>You folks know that <a href="http://www.visifire.com/blog/2010/04/20/charts-for-silverlight-4/">Windows Phone 7 Charts are possible with Visifire</a>. Due to some breaking changes in the latest Beta release of Windows Phone Developer Tools users had <a href="http://www.dynamicslight.com/2010/06/fuel-my-car-windows-phone-7-app/">issues</a> using Visifire. We have decided to ship separate binaries for WP7 users. All that changes is that one has to provide reference to SLWpVisifire.Charts.dll instead of regular Visifire for Silverlight binaries. Listed below are few links to get you started quickly with Windows Phone 7 Charts:</p>
<ul>
<li><a href="http://visifire.com/documentation/Visifire_Documentation/Core_Concepts/Working_with_Code/Setting_up_WP7_Project_Environment.htm">Setting up environment for Windows Phone 7 development</a></li>
<li><a href="http://visifire.com/documentation/Visifire_Documentation/Quick_Start/WP7/Your_First_Windows_Phone_Chart.htm">Creating your first Windows Phone 7 Chart</a></li>
</ul>
<p><div id="silverlightControlHost"><object data="data:application/x-silverlight," type="application/x-silverlight-2" width="650" height="400"><param name="source" value="http://www.visifire.com/blog/wp-content/post_xaps/Visifire4Wp7.xap"/><param name="background" value="white" /><a href="http://go.microsoft.com/fwlink/?LinkID=108182" style="text-decoration: none;"><img src="http://go.microsoft.com/fwlink/?LinkId=108181" alt="Get Microsoft Silverlight" style="border-style: none"/></a></object><iframe style='visibility:hidden;height:0;width:0;border:0px'></iframe></div><br /></p>
<p><a href="http://visifire.com/download_silverlight_charts.php">Download  the latest version of Visifire here</a>. We are very excited about this release &amp; would love to have your feedback.</p>
<p>Cheers<br />
Team Visifire</p>
<div style="float: left; margin-right: 10px; margin-top: 3px;"><a href="http://twitter.com/share" class="twitter-share-button" data-text="Windows Phone 7 Charts" data-via="visifire" data-url="http://www.visifire.com/blog/2010/07/19/windows-phone-7-charts/" data-count="none" data-via="visifire" data-related=":">Tweet</a></div>]]></content:encoded>
			<wfw:commentRss>http://www.visifire.com/blog/2010/07/19/windows-phone-7-charts/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Silverlight/WPF Spline Chart</title>
		<link>http://www.visifire.com/blog/2010/07/09/silverlightwpf-spline-chart/</link>
		<comments>http://www.visifire.com/blog/2010/07/09/silverlightwpf-spline-chart/#comments</comments>
		<pubDate>Fri, 09 Jul 2010 15:52:27 +0000</pubDate>
		<dc:creator>Chirag</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[Tutorials and Samples]]></category>

		<guid isPermaLink="false">http://www.visifire.com/blog/?p=1306</guid>
		<description><![CDATA[Hi, With this release Visifire introduces Spline Chart. A Spline Chart is similar to a Line Chart except that it draws a fitted curve through the data points. The spline interpolation and smoothing is for improved presentation of data. It allows one to take a limited set of known data points and approximate transitional values. [...]]]></description>
			<content:encoded><![CDATA[<p>Hi,</p>
<p>With this release Visifire introduces Spline Chart. A Spline Chart is similar to a Line Chart except that it draws a fitted curve through the data points. The spline interpolation and smoothing is for improved presentation of data. It allows one to take a limited set of known data points and approximate transitional values.</p>
<p>Demoed below is Messi&#8217;s path to glory!</p>
<p><div id="silverlightControlHost"><object data="data:application/x-silverlight," type="application/x-silverlight-2" width="680" height="250"><param name="source" value="http://www.visifire.com/blog/wp-content/post_xaps/GoalsScoredByMessiForBarcelonaClub.xap"/><param name="background" value="white" /><a href="http://go.microsoft.com/fwlink/?LinkID=108182" style="text-decoration: none;"><img src="http://go.microsoft.com/fwlink/?LinkId=108181" alt="Get Microsoft Silverlight" style="border-style: none"/></a></object><iframe style='visibility:hidden;height:0;width:0;border:0px'></iframe></div><br /></p>
<ul>
<li><a href="http://www.visifire.com/documentation/Visifire_Documentation/Chart_Types/Spline_Chart.htm">Visit documentation on how to create a Spline Chart</a>.</li>
<li><a href="http://www.visifire.com/silverlight_spline_charts_gallery.php">Visit Gallery for more Spline Chart samples</a>.</li>
<li><a href="http://visifire.com/download_silverlight_charts.php">Download the latest version of Visifire here</a>.</li>
</ul>
<p>Cheers,<br />
Team Visifire</p>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow: hidden;"><div id="silverlightControlHost"><object data="data:application/x-silverlight," type="application/x-silverlight-2" width="">http://www.visifire.com/blog/wp-content/post_xaps/GoalsScoredByMessiForBarcelonaClub.xap" height="</a> 680"><param name="source" value="<a href="../wp-content/post_xaps/GoalsScoredByMessiForBarcelonaClub.xap"/><param name="background" value="white" /><a href="http://go.microsoft.com/fwlink/?LinkID=108182" style="text-decoration: none;"><img src="http://go.microsoft.com/fwlink/?LinkId=108181" alt="Get Microsoft Silverlight" style="border-style: none"/></a></object><iframe style='visibility:hidden;height:0;width:0;border:0px'></iframe></div><br /></div>
<div style="float: left; margin-right: 10px; margin-top: 3px;"><a href="http://twitter.com/share" class="twitter-share-button" data-text="Silverlight/WPF Spline Chart" data-via="visifire" data-url="http://www.visifire.com/blog/2010/07/09/silverlightwpf-spline-chart/" data-count="none" data-via="visifire" data-related=":">Tweet</a></div>]]></content:encoded>
			<wfw:commentRss>http://www.visifire.com/blog/2010/07/09/silverlightwpf-spline-chart/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Silverlight/WPF Radar Chart</title>
		<link>http://www.visifire.com/blog/2010/07/09/silverlightwpf-radar-chart/</link>
		<comments>http://www.visifire.com/blog/2010/07/09/silverlightwpf-radar-chart/#comments</comments>
		<pubDate>Fri, 09 Jul 2010 15:52:07 +0000</pubDate>
		<dc:creator>Chirag</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[Tutorials and Samples]]></category>

		<guid isPermaLink="false">http://www.visifire.com/blog/?p=1308</guid>
		<description><![CDATA[Hi, With this release Visifire introduces Radar Chart. A Radar Chart is a graphical method of displaying multivariate data in the form of a two-dimensional chart of three or more quantitative variables represented on axes starting from the same point. Radar Chart is also known as Web, Spider or Star Chart. Shown below is the [...]]]></description>
			<content:encoded><![CDATA[<p>Hi,</p>
<p>With this release Visifire introduces Radar Chart. A Radar Chart is a graphical method of displaying multivariate data in the form of a two-dimensional chart of three or more quantitative variables represented on axes starting from the same point. Radar Chart is also known as Web, Spider or Star Chart.</p>
<p>Shown below is the goals scored by top countries in FIFA World Cups 2006 &amp; 2010 (till date).</p>
<p><div id="silverlightControlHost"><object data="data:application/x-silverlight," type="application/x-silverlight-2" width="700" height="305"><param name="source" value="http://www.visifire.com/blog/wp-content/post_xaps/TopGoals2006-2010.xap"/><param name="background" value="white" /><a href="http://go.microsoft.com/fwlink/?LinkID=108182" style="text-decoration: none;"><img src="http://go.microsoft.com/fwlink/?LinkId=108181" alt="Get Microsoft Silverlight" style="border-style: none"/></a></object><iframe style='visibility:hidden;height:0;width:0;border:0px'></iframe></div><br /></p>
<ul>
<li><a href="http://www.visifire.com/documentation/Visifire_Documentation/Chart_Types/Radar_Chart.htm">Visit documentation on how to create a Radar Chart</a>.</li>
<li><a href="http://www.visifire.com/silverlight_radar_charts_gallery.php">Visit Gallery for more Radar Chart samples</a>.</li>
<li><a href="http://visifire.com/download_silverlight_charts.php">Download the latest version of Visifire here</a>.</li>
</ul>
<p>Cheers,<br />
Team Visifire</p>
<div style="float: left; margin-right: 10px; margin-top: 3px;"><a href="http://twitter.com/share" class="twitter-share-button" data-text="Silverlight/WPF Radar Chart" data-via="visifire" data-url="http://www.visifire.com/blog/2010/07/09/silverlightwpf-radar-chart/" data-count="none" data-via="visifire" data-related=":">Tweet</a></div>]]></content:encoded>
			<wfw:commentRss>http://www.visifire.com/blog/2010/07/09/silverlightwpf-radar-chart/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Realtime Update Using DataBinding</title>
		<link>http://www.visifire.com/blog/2010/07/02/realtime-update-using-databinding/</link>
		<comments>http://www.visifire.com/blog/2010/07/02/realtime-update-using-databinding/#comments</comments>
		<pubDate>Fri, 02 Jul 2010 11:37:58 +0000</pubDate>
		<dc:creator>somnath</dc:creator>
				<category><![CDATA[Tutorials and Samples]]></category>

		<guid isPermaLink="false">http://www.visifire.com/blog/?p=1226</guid>
		<description><![CDATA[DataBinding provides a simple way to manipulate and interact with data. DataBinding does the clear separation between UI implementation and business logic layer. The data can be imported from any data source like database, file etc. The UI element can be any framework element like DataGrid, Chart etc to visualize the data. Connection between UI [...]]]></description>
			<content:encoded><![CDATA[<p>DataBinding provides a simple way to manipulate and interact with data. DataBinding does the clear separation between UI implementation and business logic layer. The data can be imported from any data source like database, file etc. The UI element can be any framework element like DataGrid, Chart etc to visualize the data. Connection between UI and data object results in flow of data between them. When DataBinding is done, if the data changes then UI element which is bound to the data object also changes. In the case of two ways binding, changes made to UI element will cause data object to change.</p>
<p>In this post I will discuss about &#8220;How DataBinding takes place at real-time&#8221;. I prefer updating the chart at real-time without manipulating the Visifire chart elements directly. I will be doing multiple operations like add, delete, update with a collection and it’s good to see the changes reflecting in the chart at real-time.</p>
<div><div id="silverlightControlHost"><object data="data:application/x-silverlight," type="application/x-silverlight-2" width="700" height="264"><param name="source" value="http://www.visifire.com/blog/wp-content/post_xaps/Realtime-Update-Using-DataBinding.xap"/><param name="background" value="white" /><a href="http://go.microsoft.com/fwlink/?LinkID=108182" style="text-decoration: none;"><img src="http://go.microsoft.com/fwlink/?LinkId=108181" alt="Get Microsoft Silverlight" style="border-style: none"/></a></object><iframe style='visibility:hidden;height:0;width:0;border:0px'></iframe></div><br /></div>
<div style="text-align: justify;">The figure shown below explains the conceptual representation of DataBinding between Visifire Chart and an ObservableCollection. DataRow is a class which holds Data for a DataPoint. A DataRow defines one or more number of properties to be mapped with DataPoints according to the data-mapping-rules defined at Series level. DataRows is a collection of one or more DataRow. Every record present in the DataRows collection represents a DataPoint.</div>
<div><img class="size-full wp-image-1234 alignnone" title="Silverlight-Visifire-Chart-Realtime-Update-Using-DataBinding" src="http://www.visifire.com/blog/wp-content/uploads/2010/06/Silverlight-Visifire-Chart-Realtime-Update-Using-DataBinding.jpg" alt="Visifire-Chart-Realtime-Update-Using-DataBinding.xap" width="699" height="717" /></div>
<div>DataMapping rules which are to be specified in DataSeries are  shown below:</div>
<pre>&lt;vc:DataSeries RenderAs="Column" LabelEnabled="True" Margin="-1,0,1,0"&gt;
    &lt;vc:DataSeries.DataMappings&gt;
        &lt;vc:DataMapping MemberName="AxisXLabel" Path="AxisXLabel"&gt;&lt;/vc:DataMapping&gt;
        &lt;vc:DataMapping MemberName="YValue" Path="YValue"&gt;
    &lt;/vc:DataSeries.DataMappings&gt;
 &lt;/vc:DataSeries&gt;
</pre>
<div>
<p>In  this example we are going to use dataRows as DataSource. Here  DataSource property of the DataSeries has been set from managed code.</p>
<pre>MyChart.Series[0].DataSource  = dataRows;</pre>
<p>Please note that I  have used a DataGrid to dispaly  the data present in dataRows in a tabular format. So I have bound dataRows  collection with the DataGrid also. As DataGrid is bound with the  collection, one can update the data present in collection just by  editing the DataGrid cells. We can even directly perform Add, Remove  operations with dataRows collection which will reflect in Chart as well  as DataGrid.</p>
<p>DataRow is the class which has two properties named   <strong>AxisXLabel</strong> and <strong>YValue</strong>. This class contains business logic  which is required to interact with values of dataRows. You may  wonder how does it know when the property value changes? The answer to  this question lies in the interface called <strong>INotifyPropertyChanged</strong> which is in <strong>System.ComponentModel </strong>namespace. The DataRow class  implements <strong>INotifyPropertyChanged </strong>which notifies when the business  object changes. So, whenever the value changes in the DataSource, corresponding property will trigger <strong>PropertyChanged</strong> event.</p>
</div>
<pre style="height: 200px; overflow: auto; font-size: 12px; background-color: #f3f3f3; border-width: 1px; border-color: #808080;">using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.ComponentModel;
using System.Collections.ObjectModel;

namespace VisifireDataBinding
{ 

  public class DataRow : INotifyPropertyChanged
  {
    /// &lt;summary&gt;
    /// Selected property is used to know whether the DataRow is selected  or not
    /// &lt;/summary&gt;
    public Boolean Selected
    {
       get
       {
          return _select;
       }
       set
       {
         _select = value;

        if (PropertyChanged != null)
            PropertyChanged(this, new PropertyChangedEventArgs("Select"));
        }
    }

    /// &lt;summary&gt;
    /// AxisXLabel property
    /// &lt;/summary&gt;
    public String AxisXLabel
    {
        get
        {
            return _axisXLabel;
        }
        set
        {
           _axisXLabel = value;

           if (PropertyChanged != null)
               PropertyChanged(this, new PropertyChangedEventArgs("AxisXLabel"));
         }
     }

     /// &lt;summary&gt;
     /// YValue property
     /// &lt;/summary&gt;
     public Double YValue
     {
         get
         {
             return _yValue;
         }
         set
         {
            _yValue = value;

            if (PropertyChanged != null)
                PropertyChanged(this, new PropertyChangedEventArgs("YValue"));
         }
      }

      #region INotifyPropertyChanged Members

        public event PropertyChangedEventHandler PropertyChanged;

      #endregion

      Double _yValue;
      String _axisXLabel;
      Boolean _select;
   }
}
</pre>
<p>You can find additional information about <strong>InotificationPropertyChanged</strong> <a href="http://msdn.microsoft.com/en-us/library/system.componentmodel.inotifypropertychanged.aspx" target="_blank">here</a>.</p>
<p>As a result, chart is displayed with chart contents as shown below.</p>
<p><img class="size-full wp-image-1291 alignnone" src="http://www.visifire.com/blog/wp-content/uploads/2010/06/visifire-chart11.jpg" alt="" width="388" height="227" /></p>
<p><strong>DataBinding makes it easy to display &#8220;live&#8221; data.</strong></p>
<p>Changes  made in the DataSource also causes changes in the chart without  requiring any coding on your part! Now manipulate the values in  DataGrid which may include addition, removal, update of DataPoint  properties.</p>
<p>The DataGrid after adding properties for one or more  DataPoint will look like below.</p>
<p><img class="alignnone" src="http://www.visifire.com/blog/wp-content/uploads/2010/06/visifire-chart2.jpg" alt="" width="214" height="232" /></p>
<p>The Output changes!</p>
<p><img class="size-full wp-image-1292 alignnone" src="http://www.visifire.com/blog/wp-content/uploads/2010/06/visifire-chart31.jpg" alt="" width="388" height="227" /></p>
<p>Above image shows the chart  with newly added AxisXLabel and YValue at real-time. Notice  as I change values in DataGrid, the chart gets updated automatically.</p>
<p>You  can download the source code of the sample demo application <a href="http://www.visifire.com/downloads/samples/managed/visifire-chart-realtime-update-using-databinding.zip">here</a>.</p>
<p>Cheers,<br />
Team Visifire</p>
<div style="float: left; margin-right: 10px; margin-top: 3px;"><a href="http://twitter.com/share" class="twitter-share-button" data-text="Realtime Update Using DataBinding" data-via="visifire" data-url="http://www.visifire.com/blog/2010/07/02/realtime-update-using-databinding/" data-count="none" data-via="visifire" data-related=":">Tweet</a></div>]]></content:encoded>
			<wfw:commentRss>http://www.visifire.com/blog/2010/07/02/realtime-update-using-databinding/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Visifire Now Supports DataBinding</title>
		<link>http://www.visifire.com/blog/2010/02/16/visifire-now-supports-databinding/</link>
		<comments>http://www.visifire.com/blog/2010/02/16/visifire-now-supports-databinding/#comments</comments>
		<pubDate>Tue, 16 Feb 2010 12:11:11 +0000</pubDate>
		<dc:creator>Sunil</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[Releases]]></category>
		<category><![CDATA[Tutorials and Samples]]></category>

		<guid isPermaLink="false">http://www.visifire.com/blog/?p=829</guid>
		<description><![CDATA[Today we are releasing the much awaited DataBinding feature in Visifire 3.0.3 beta 3. Now you can Bind any DataSource at the Series level so that the Chart gets generated automatically and reflects any change. Below is a demonstration of DataBinding. You can change the Values in DataGrid and the Chart gets updated automatically. Here [...]]]></description>
			<content:encoded><![CDATA[<p>Today we are releasing the much awaited DataBinding feature in Visifire 3.0.3 beta 3. Now you can Bind any DataSource at the Series level so that the Chart gets generated automatically and reflects any change. Below is a demonstration of DataBinding. You can change the Values in DataGrid and the Chart gets updated automatically.</p>
<p><div id="silverlightControlHost"><object data="data:application/x-silverlight," type="application/x-silverlight-2" width="635" height="320"><param name="source" value="http://www.visifire.com/blog/wp-content/post_xaps/VisifireDataBinding.xap"/><param name="background" value="white" /><a href="http://go.microsoft.com/fwlink/?LinkID=108182" style="text-decoration: none;"><img src="http://go.microsoft.com/fwlink/?LinkId=108181" alt="Get Microsoft Silverlight" style="border-style: none"/></a></object><iframe style='visibility:hidden;height:0;width:0;border:0px'></iframe></div><br /></p>
<p><a href="http://visifire.com/downloads/samples/managed/VisifireDataBinding.zip">Here</a> is the source code for the above sample. Also you can visit Visifire documentation <a href="http://www.visifire.com/documentation/Visifire_Documentation/Core_Concepts/Working_with_DataBinding/DataBinding_Overview.htm">here</a> for more info.</p>
<p>You can download Visifire 3.0.3 beta 3 from our <a href="http://www.visifire.com/download_silverlight_charts.php">download page</a>.</p>
<p>Cheers,<br />
Team Visifire</p>
<input id="gwProxy" type="hidden" />
<input id="jsProxy" onclick="jsCall();" type="hidden" />
<input id="gwProxy" type="hidden" />
<input id="jsProxy" onclick="jsCall();" type="hidden" />
<input id="gwProxy" type="hidden" />
<input id="jsProxy" onclick="jsCall();" type="hidden" />
<div style="float: left; margin-right: 10px; margin-top: 3px;"><a href="http://twitter.com/share" class="twitter-share-button" data-text="Visifire Now Supports DataBinding" data-via="visifire" data-url="http://www.visifire.com/blog/2010/02/16/visifire-now-supports-databinding/" data-count="none" data-via="visifire" data-related=":">Tweet</a></div>]]></content:encoded>
			<wfw:commentRss>http://www.visifire.com/blog/2010/02/16/visifire-now-supports-databinding/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Exporting Visifire Silverlight Chart as Image</title>
		<link>http://www.visifire.com/blog/2009/11/12/exporting-visifire-silverlight-chart-as-image/</link>
		<comments>http://www.visifire.com/blog/2009/11/12/exporting-visifire-silverlight-chart-as-image/#comments</comments>
		<pubDate>Thu, 12 Nov 2009 15:11:00 +0000</pubDate>
		<dc:creator>Chirag</dc:creator>
				<category><![CDATA[Tutorials and Samples]]></category>

		<guid isPermaLink="false">http://www.visifire.com/blog/?p=546</guid>
		<description><![CDATA[Exporting Silverlight charts to images has been the most coveted feature. In this tutorial, I am going to show you to export Visifire Silverlight chart as image from managed code. So before we start lets check out the live example below. Project Setup Create a “Silverlight Application” project. Download the latest Visifire binaries from here. [...]]]></description>
			<content:encoded><![CDATA[<p>Exporting Silverlight charts to images has been the most coveted feature. In this tutorial, I am going to show you to export Visifire Silverlight chart as image from managed code. So before we start lets check out the live example below.</p>
<p><div id="silverlightControlHost"><object data="data:application/x-silverlight," type="application/x-silverlight-2" width="500" height="330"><param name="source" value="http://www.visifire.com/blog/wp-content/post_xaps/SLSave2Image.xap"/><param name="background" value="white" /><a href="http://go.microsoft.com/fwlink/?LinkID=108182" style="text-decoration: none;"><img src="http://go.microsoft.com/fwlink/?LinkId=108181" alt="Get Microsoft Silverlight" style="border-style: none"/></a></object><iframe style='visibility:hidden;height:0;width:0;border:0px'></iframe></div><br /></p>
<h3><strong>Project Setup</strong></h3>
<p>Create a “Silverlight Application” project. Download the latest Visifire binaries from <a href="http://www.visifire.com/download_silverlight_charts.php">here</a>. Extract the Zip file and add reference for the file named “SLVisifire.Charts.dll”. In this sample, I am going to use WriteableBitmap class in order to extract the pixel wise color information of the chart rendered inside Silverlight content. We will take help of JpegEncoder provided by a third party library called FJ.Core to encode the raster information to file stream.</p>
<p>Please download FJ.Core library from <a href="http://code.google.com/p/fjcore/">here</a> and add the FJ.Core.dll as reference to the project.</p>
<p><img src="http://www.visifire.com/blog/wp-content/post_images/ExportingVisifireSilverlightChartsAsImage/solutionexplorer.JPG" alt="" /></p>
<p>Below are the steps that we are going to follow.</p>
<ol>
<li>Construct the Chart XAML inside MainPage.xaml.</li>
<li>Exporting Chart as image.</li>
</ol>
<h3><strong>Constructing Chart XAML</strong></h3>
<p>Open MainPage.xaml page, add a Chart and a button inside it as shown below:</p>
<div style="border: 1px solid gray; margin: 20px 0px 10px; padding: 4px; overflow: auto; line-height: 12pt; background-color: #f4f4f4; width: 97.5%; font-family: consolas,'Courier New',courier,monospace; max-height: 200px; font-size: 8pt; cursor: text;">
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;">&lt;UserControl x:Class=<span style="color: #006080">"SLSave2Image.MainPage"</span>
    xmlns=<span style="color: #006080">"http://schemas.microsoft.com/winfx/2006/xaml/presentation"</span>
    xmlns:x=<span style="color: #006080">"http://schemas.microsoft.com/winfx/2006/xaml"</span>
    xmlns:d=<span style="color: #006080">"http://schemas.microsoft.com/expression/blend/2008"</span>
    xmlns:mc=<span style="color: #006080">"http://schemas.openxmlformats.org/markup-compatibility/2006"</span>
    xmlns:vc=<span style="color: #006080">"clr-namespace:Visifire.Charts;assembly=SLVisifire.Charts"</span>
    mc:Ignorable=<span style="color: #006080">"d"</span> Width=<span style="color: #006080">"500"</span> Height=<span style="color: #006080">"480"</span>&gt;
    &lt;Grid x:Name=<span style="color: #006080">"LayoutRoot"</span>&gt;
        &lt;StackPanel&gt;
            &lt;vc:Chart Name=<span style="color: #006080">"MyChart"</span> Width=<span style="color: #006080">"500"</span> Height=<span style="color: #006080">"300"</span> Theme=<span style="color: #006080">"Theme1"</span>&gt;

                &lt;vc:Chart.Titles&gt;
                    &lt;vc:Title Text=<span style="color: #006080">"Visifire Chart"</span>/&gt;
                &lt;/vc:Chart.Titles&gt;

                &lt;vc:Chart.Series&gt;
                    &lt;vc:DataSeries RenderAs=<span style="color: #006080">"Column"</span> LabelEnabled=<span style="color: #006080">"True"</span>&gt;
                        &lt;vc:DataSeries.DataPoints&gt;
                            &lt;vc:DataPoint AxisXLabel=<span style="color: #006080">"Jan"</span> YValue=<span style="color: #006080">"35"</span>/&gt;
                            &lt;vc:DataPoint AxisXLabel=<span style="color: #006080">"Feb"</span> YValue=<span style="color: #006080">"32"</span>/&gt;
                            &lt;vc:DataPoint AxisXLabel=<span style="color: #006080">"Mar"</span> YValue=<span style="color: #006080">"27"</span>/&gt;
                            &lt;vc:DataPoint AxisXLabel=<span style="color: #006080">"Apr"</span> YValue=<span style="color: #006080">"17"</span>/&gt;
                            &lt;vc:DataPoint AxisXLabel=<span style="color: #006080">"May"</span> YValue=<span style="color: #006080">"16"</span>/&gt;
                        &lt;/vc:DataSeries.DataPoints&gt;
                    &lt;/vc:DataSeries&gt;
                &lt;/vc:Chart.Series&gt;
            &lt;/vc:Chart&gt;
            &lt;Button Name=<span style="color: #006080">"ButtonSave"</span> Height=<span style="color: #006080">"25"</span> Width=<span style="color: #006080">"160"</span> Content=<span style="color: #006080">"Save Chart"</span> &gt;&lt;/Button&gt;
        &lt;/StackPanel&gt;
    &lt;/Grid&gt;
&lt;/UserControl&gt;</pre>
</div>
<h3><strong><strong>Exporting Chart as image<br />
</strong></strong></h3>
<p>Now open MainPage.xaml.cs page and add the following namespaces.</p>
<div style="border: 1px solid gray; margin: 20px 0px 10px; padding: 4px; overflow: auto; line-height: 12pt; background-color: #f4f4f4; width: 97.5%; font-family: consolas,'Courier New',courier,monospace; max-height: 200px; font-size: 8pt; cursor: text;">
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"><span style="color: #0000ff">using</span> FluxJpeg.Core;
<span style="color: #0000ff">using</span> FluxJpeg.Core.Encoder;
<span style="color: #0000ff">using</span> System.Windows.Media.Imaging;
<span style="color: #0000ff">using</span> System.IO;
<span style="color: #0000ff">using</span> Visifire.Charts;</pre>
</div>
<p>Now attach an event handler for Click event of Button inside the Page constructor.</p>
<div style="border: 1px solid gray; margin: 20px 0px 10px; padding: 4px; overflow: auto; line-height: 12pt; background-color: #f4f4f4; width: 97.5%; font-family: consolas,'Courier New',courier,monospace; max-height: 200px; font-size: 8pt; cursor: text;">
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"><span style="color: #0000ff">public</span> MainPage()
{
    InitializeComponent();

    ButtonSave.Click += <span style="color: #0000ff">new</span> RoutedEventHandler(ButtonSave_Click);
}

<span style="color: #0000ff">void</span> ButtonSave_Click(<span style="color: #0000ff">object</span> sender, RoutedEventArgs e)
{
    SaveToImage(MyChart);
}</pre>
</div>
<p>Inside the ButtonSave event handler declare a function called SaveToImage() which will accept Chart as parameter as shown above.</p>
<p>Now inside the function definition, create a WriteableBitmap out of a Chart and collect the raster information from it. Then encode the raster information to file stream using JpegEncoder present in FJ.Core library as shown below. Finally save the file stream as image into hard drive.</p>
<div style="border: 1px solid gray; margin: 20px 0px 10px; padding: 4px; overflow: auto; line-height: 12pt; background-color: #f4f4f4; width: 97.5%; font-family: consolas,'Courier New',courier,monospace; max-height: 200px; font-size: 8pt; cursor: text;">
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: consolas,'Courier New',courier,monospace; color: black; font-size: 8pt;"><span style="color: #008000">/// &lt;summary&gt;</span>
<span style="color: #008000">/// Save Visifire chart as Image</span>
<span style="color: #008000">/// &lt;/summary&gt;</span>
<span style="color: #008000">/// &lt;param name="Chart"&gt;Visifire.Charts.Chart&lt;/param&gt;</span>
<span style="color: #0000ff">private</span> <span style="color: #0000ff">void</span> SaveToImage(Chart chart)
{
    <span style="color: #0000ff">try</span>
    {
        WriteableBitmap bitmap = <span style="color: #0000ff">new</span> WriteableBitmap(chart, <span style="color: #0000ff">null</span>);

        <span style="color: #0000ff">if</span> (bitmap != <span style="color: #0000ff">null</span>)
        {
            SaveFileDialog saveDlg = <span style="color: #0000ff">new</span> SaveFileDialog();
            saveDlg.Filter = <span style="color: #006080">"JPEG Files (*.jpeg)|*.jpeg"</span>;
            saveDlg.DefaultExt = <span style="color: #006080">".jpeg"</span>;

            <span style="color: #0000ff">if</span> ((<span style="color: #0000ff">bool</span>)saveDlg.ShowDialog())
            {
                <span style="color: #0000ff">using</span> (Stream fs = saveDlg.OpenFile())
                {
                    MemoryStream stream = GetImageStream(bitmap);

                    <span style="color: #008000">//Get Bytes from memory stream and write into IO stream</span>
                    <span style="color: #0000ff">byte</span>[] binaryData = <span style="color: #0000ff">new</span> Byte[stream.Length];
                    <span style="color: #0000ff">long</span> bytesRead = stream.Read(binaryData, 0, (<span style="color: #0000ff">int</span>)stream.Length);
                    fs.Write(binaryData, 0, binaryData.Length);
                }
            }
        }
    }
    <span style="color: #0000ff">catch</span>(Exception ex)
    {
        System.Diagnostics.Debug.WriteLine(<span style="color: #006080">"Note: Please make sure that Height and Width of the chart is set properly."</span>);
        System.Diagnostics.Debug.WriteLine(ex.Message);
    }
}

<span style="color: #008000">/// &lt;summary&gt;</span>
<span style="color: #008000">/// Get image MemoryStream from WriteableBitmap</span>
<span style="color: #008000">/// &lt;/summary&gt;</span>
<span style="color: #008000">/// &lt;param name="bitmap"&gt;WriteableBitmap&lt;/param&gt;</span>
<span style="color: #008000">/// &lt;returns&gt;MemoryStream&lt;/returns&gt;</span>
<span style="color: #0000ff">public</span> <span style="color: #0000ff">static</span> MemoryStream GetImageStream(WriteableBitmap bitmap)
{
    <span style="color: #0000ff">byte</span>[][,] raster = ReadRasterInformation(bitmap);
    <span style="color: #0000ff">return</span> EncodeRasterInformationToStream(raster, ColorSpace.RGB);
} 

<span style="color: #008000">/// &lt;summary&gt;</span>
<span style="color: #008000">/// Reads raster information from WriteableBitmap</span>
<span style="color: #008000">/// &lt;/summary&gt;</span>
<span style="color: #008000">/// &lt;param name="bitmap"&gt;WriteableBitmap&lt;/param&gt;</span>
<span style="color: #008000">/// &lt;returns&gt;Array of bytes&lt;/returns&gt;</span>
<span style="color: #0000ff">public</span> <span style="color: #0000ff">static</span> <span style="color: #0000ff">byte</span>[][,] ReadRasterInformation(WriteableBitmap bitmap)
{
    <span style="color: #0000ff">int</span> width = bitmap.PixelWidth;
    <span style="color: #0000ff">int</span> height = bitmap.PixelHeight;
    <span style="color: #0000ff">int</span> bands = 3;
    <span style="color: #0000ff">byte</span>[][,] raster = <span style="color: #0000ff">new</span> <span style="color: #0000ff">byte</span>[bands][,];

    <span style="color: #0000ff">for</span> (<span style="color: #0000ff">int</span> i = 0; i &lt; bands; i++)
    {
        raster[i] = <span style="color: #0000ff">new</span> <span style="color: #0000ff">byte</span>[width, height];
    }

    <span style="color: #0000ff">for</span> (<span style="color: #0000ff">int</span> row = 0; row &lt; height; row++)
    {
        <span style="color: #0000ff">for</span> (<span style="color: #0000ff">int</span> column = 0; column &lt; width; column++)
        {
            <span style="color: #0000ff">int</span> pixel = bitmap.Pixels[width * row + column];
            raster[0][column, row] = (<span style="color: #0000ff">byte</span>)(pixel &gt;&gt; 16);
            raster[1][column, row] = (<span style="color: #0000ff">byte</span>)(pixel &gt;&gt; 8);
            raster[2][column, row] = (<span style="color: #0000ff">byte</span>)pixel;
        }
    }

    <span style="color: #0000ff">return</span> raster;
}

<span style="color: #008000">/// &lt;summary&gt;</span>
<span style="color: #008000">/// Encode raster information to MemoryStream</span>
<span style="color: #008000">/// &lt;/summary&gt;</span>
<span style="color: #008000">/// &lt;param name="raster"&gt;Raster information (Array of bytes)&lt;/param&gt;</span>
<span style="color: #008000">/// &lt;param name="colorSpace"&gt;ColorSpace used&lt;/param&gt;</span>
<span style="color: #008000">/// &lt;returns&gt;MemoryStream&lt;/returns&gt;</span>
<span style="color: #0000ff">public</span> <span style="color: #0000ff">static</span> MemoryStream EncodeRasterInformationToStream(<span style="color: #0000ff">byte</span>[][,] raster, ColorSpace colorSpace)
{
    ColorModel model = <span style="color: #0000ff">new</span> ColorModel { colorspace = ColorSpace.RGB };
    FluxJpeg.Core.Image img = <span style="color: #0000ff">new</span> FluxJpeg.Core.Image(model, raster);

    <span style="color: #008000">//Encode the Image as a JPEG</span>
    MemoryStream stream = <span style="color: #0000ff">new</span> MemoryStream();
    FluxJpeg.Core.Encoder.JpegEncoder encoder = <span style="color: #0000ff">new</span> FluxJpeg.Core.Encoder.JpegEncoder(img, 100, stream);
    encoder.Encode();

    <span style="color: #008000">// Back to the start</span>
    stream.Seek(0, SeekOrigin.Begin);

    <span style="color: #0000ff">return</span> stream;
}</pre>
</div>
<p>You can download the complete solution <a href="http://www.visifire.com/downloads/samples/managed/sl_save2image_121109.zip">here</a></p>
<p>(Hat tip to Visifire user <a href="http://www.visifire.com/forums/index.php?showuser=1267">Sagi Karni, Intel Corp</a>)</p>
<p>Cheers,<br />
Team Visifire</p>
<div style="float: left; margin-right: 10px; margin-top: 3px;"><a href="http://twitter.com/share" class="twitter-share-button" data-text="Exporting Visifire Silverlight Chart as Image" data-via="visifire" data-url="http://www.visifire.com/blog/2009/11/12/exporting-visifire-silverlight-chart-as-image/" data-count="none" data-via="visifire" data-related=":">Tweet</a></div>]]></content:encoded>
			<wfw:commentRss>http://www.visifire.com/blog/2009/11/12/exporting-visifire-silverlight-chart-as-image/feed/</wfw:commentRss>
		<slash:comments>18</slash:comments>
		</item>
	</channel>
</rss>

