<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://community.softwarefx.com/utility/FeedStylesheets/atom.xsl" media="screen"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en"><title type="html">WPF Blog</title><subtitle type="html" /><id>http://community.softwarefx.com/blogs/wpf/atom.aspx</id><link rel="alternate" type="text/html" href="http://community.softwarefx.com/blogs/wpf/default.aspx" /><link rel="self" type="application/atom+xml" href="http://community.softwarefx.com/blogs/wpf/atom.aspx" /><generator uri="http://communityserver.org" version="3.0.31118.962">Community Server</generator><updated>2009-07-20T20:54:00Z</updated><entry><title>Real time charts in WPF</title><link rel="alternate" type="text/html" href="http://community.softwarefx.com/blogs/wpf/archive/2009/12/03/real-time-charts-in-wpf.aspx" /><id>http://community.softwarefx.com/blogs/wpf/archive/2009/12/03/real-time-charts-in-wpf.aspx</id><published>2009-12-04T03:13:11Z</published><updated>2009-12-04T03:13:11Z</updated><content type="html">&lt;p&gt;Real time support is one of those features that had to be cut from 8.0 because of the schedule, but customer feedback in both our forums and email was loud and clear, there are some of you that need to update the chart often and need a high performance redraw strategy.&lt;/p&gt;  &lt;p&gt;Before we go into the real time API and behavior in Chart FX for WPF 8.1 let’s discuss how the chart control responds to non-realtime changes in the data&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Binding to objects that support INotifyPropertyChanged&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;When Chart FX receives a collection of CLR objects that support INotifyPropertyChanged, it will attach to the PropertyChanged event, then as soon as the event is fired because of a property change the chart will process the new value and mark itself as dirty. Note that this means that if you change more than one of your CLR objects quickly the chart will only “repaint” once. The quotes around repaint are because it is a little more complex than that, we will run our paint code but then detect that the changes do not need a full WPF redraw and instead animate the data changes.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Binding to a collection that support INotifyCollectionChanged&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;If the collection passed to Chart FX supports this interface we will also track changes to the collection, when the collection fires its Collection changed event the chart will process the new data and then mark itself as dirty, normally you will not get animations in this scenario. We will process the data changes immediately but delay the painting so it is also possible that if you add two objects to the collection quickly we will only repaint the chart once.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Real Time Support&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;In both these scenarios, Chart FX is going through a full repaint process which works fine for casual use but if the data changes often (e.g. once per second or quicker) it will probably generate high CPU usage, enter the real time API, when using this API you will first configure the maximum number of points the chart will hold, once this number is reached, each additional value will bump the oldest value out of the chart to keep memory usage steady.&lt;/p&gt;  &lt;pre class="code"&gt;chart1.RealTime.BufferSize = 120;
chart1.Data.Series = 1;
chart1.Data.Points = 120;&lt;/pre&gt;
&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;

&lt;p&gt;You will then run a code similar to this every time you want to add one or more points to the chart&lt;/p&gt;

&lt;pre class="code"&gt;chart1.RealTime.BeginAddData(1, &lt;span style="color:#2b91af;"&gt;RealTimeAction&lt;/span&gt;.Append);
chart1.Data[0, 0] = newValue;&lt;br /&gt;&lt;span style="color:green;"&gt;//chart1.Data[0, 1] = newValue2;
&lt;/span&gt;chart1.RealTime.EndAddData(&lt;span style="color:blue;"&gt;false&lt;/span&gt;, &lt;span style="color:blue;"&gt;false&lt;/span&gt;);&lt;/pre&gt;
&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;

&lt;p&gt;The first parameter to BeginAddData indicates the number of points you plan to add, note that when adding the points you will use 0 based index for the points regardless of how many points have been added to the chart before this. The first boolean parameter to EndData specifies whether labels should be scrolled, the second specifies whether the chart should scroll to the end if scrolling is enabled.&lt;/p&gt;

&lt;p&gt;Once we receive the data we do not a run a standard paint process but instead process the new data and move the visual objects accordingly, because of this we only support realtime in conjunction with certain gallery types (Bar, Line and Area), also several features such as stacked are currently unsupported in realtime.&lt;/p&gt;

&lt;p&gt;Performance is still being tweaked but a chart holding hundreds of points and being updated 1 – 5 times per second will only use a small percentage of the CPU (1 – 10%) even on a laptop.&lt;/p&gt;

&lt;p&gt;JuanC&lt;/p&gt;&lt;img src="http://community.softwarefx.com/aggbug.aspx?PostID=26527" width="1" height="1"&gt;</content><author><name>JuanC</name><uri>http://community.softwarefx.com/members/JuanC.aspx</uri></author><category term="8.1" scheme="http://community.softwarefx.com/blogs/wpf/archive/tags/8.1/default.aspx" /><category term="RealTime" scheme="http://community.softwarefx.com/blogs/wpf/archive/tags/RealTime/default.aspx" /></entry><entry><title>Series Transform: Plotting the rate of change</title><link rel="alternate" type="text/html" href="http://community.softwarefx.com/blogs/wpf/archive/2009/11/18/series-transform-plotting-the-rate-of-change.aspx" /><id>http://community.softwarefx.com/blogs/wpf/archive/2009/11/18/series-transform-plotting-the-rate-of-change.aspx</id><published>2009-11-18T14:29:57Z</published><updated>2009-11-18T14:29:57Z</updated><content type="html">&lt;p&gt;This post discusses functionality in Chart FX for WPF 8.1. For more information click &lt;a href="http://community.softwarefx.com/blogs/wpf/archive/2009/11/18/chart-fx-for-wpf-8-1.aspx" target="_blank"&gt;here&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;Chart FX for WPF 8.0 includes support for data transforms including &lt;a href="http://community.softwarefx.com/blogs/wpf/archive/2009/10/03/transforming-data-combining-small-elements-into-an-other-category.aspx" target="_blank"&gt;OtherTransform&lt;/a&gt; and &lt;a href="http://community.softwarefx.com/blogs/wpf/archive/2009/08/05/comparing-multiple-variables-using-a-pane-matrix-part-1-of-2.aspx" target="_blank"&gt;CrosstabTransform&lt;/a&gt;. These transforms work with the data as a whole and they will typically affect the shape of the data i.e. they will affect the number of series or points plotted in your chart. Sometimes to analyze the data more effectively you also need minor tweaks on how the data is plotted, to accomplish this we will be supporting a new concept called Series Transforms.&lt;/p&gt;  &lt;p&gt;A series transform is a class that affects the values plotted for a single series, a very simple yet useful example would be to plot the percentage of change from the previous value, e.g. let’s plot the US gross domestic product since 1990&lt;/p&gt;  &lt;p&gt;&lt;a href="http://community.softwarefx.com/blogs/wpf/RateOfChange1_61ED4749.png"&gt;&lt;img style="border-bottom:0px;border-left:0px;display:inline;border-top:0px;border-right:0px;" title="RateOfChange1" border="0" alt="RateOfChange1" src="http://community.softwarefx.com/blogs/wpf/RateOfChange1_thumb_33278EA7.png" width="244" height="150" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Even though this post is all about data analysis, we also want to show our visual capabilities, this look was heavily “inspired” on a chart about a certain golfer yearly earnings I saw some time ago on a news site. Note that all the visual attributes used here (a couple of templates plus some property manipulation) are supported in 8.0 as well, additionally we are using the “Helvetica Neue” font created by &lt;a href="http://www.linotype.com" target="_blank"&gt;Linotype&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;If you are analyzing this chart it is hard to draw any conclusions besides the fact that the GDP seems to grow linearly on the 90’s and then dips a little in the early 2000’s before retaking its previous almost linear trend. Let’s add the Rate of Change Transform and see what happens&lt;/p&gt;  &lt;pre class="code"&gt;  &lt;span style="color:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="color:blue;"&gt;:&lt;/span&gt;&lt;span style="color:#a31515;"&gt;SeriesAttributes.Transform&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;
    &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;cfxData&lt;/span&gt;&lt;span style="color:blue;"&gt;:&lt;/span&gt;&lt;span style="color:#a31515;"&gt;RateOfChangeTransform&lt;/span&gt;&lt;span style="color:blue;"&gt;/&amp;gt;
  &amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="color:blue;"&gt;:&lt;/span&gt;&lt;span style="color:#a31515;"&gt;SeriesAttributes.Transform&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;

&lt;pre class="code"&gt;&lt;span style="color:blue;"&gt;&lt;a href="http://community.softwarefx.com/blogs/wpf/RateOfChange2_526A357A.png"&gt;&lt;img style="border-bottom:0px;border-left:0px;display:inline;border-top:0px;border-right:0px;" title="RateOfChange2" border="0" alt="RateOfChange2" src="http://community.softwarefx.com/blogs/wpf/RateOfChange2_thumb_5191CF90.png" width="244" height="150" /&gt;&lt;/a&gt; &lt;/span&gt;&lt;/pre&gt;
&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;You can see what a different picture is painted when we plot the percentage change year-over-year, note that in the 90’s the GDP actually go up and down between 4.6 and 6% and the dip in the early 200’s is considerable as it goes down from 6% to 3%. Also note that at the end of the plot there is a clear down trend that was almost impossible to detect on the original chart.&lt;/p&gt;

&lt;p&gt;The transform also gets a chance to influence the axis labels (we are manually adjusting the title in our sample) and the tooltips as shown in the next figure.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://community.softwarefx.com/blogs/wpf/RateOfChange3_10EF8321.png"&gt;&lt;img style="border-bottom:0px;border-left:0px;display:inline;border-top:0px;border-right:0px;" title="RateOfChange3" border="0" alt="RateOfChange3" src="http://community.softwarefx.com/blogs/wpf/RateOfChange3_thumb_10171D37.png" width="244" height="150" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;This transform would also be very useful if you are plotting more than one series when the data range on the series are slightly off, for example if you are plotting sales for 2 products where product A sales range between 1 and 7 millions and product B sales range between 20 and 50 millions, it is very hard to compare growth but the rate of change as a percentage will clearly give you a normalized view of your data.&lt;/p&gt;

&lt;p&gt;JuanC&lt;/p&gt;&lt;img src="http://community.softwarefx.com/aggbug.aspx?PostID=26419" width="1" height="1"&gt;</content><author><name>JuanC</name><uri>http://community.softwarefx.com/members/JuanC.aspx</uri></author><category term="Data Transform" scheme="http://community.softwarefx.com/blogs/wpf/archive/tags/Data+Transform/default.aspx" /><category term="8.1" scheme="http://community.softwarefx.com/blogs/wpf/archive/tags/8.1/default.aspx" /></entry><entry><title>Chart FX for WPF 8.1</title><link rel="alternate" type="text/html" href="http://community.softwarefx.com/blogs/wpf/archive/2009/11/18/chart-fx-for-wpf-8-1.aspx" /><id>http://community.softwarefx.com/blogs/wpf/archive/2009/11/18/chart-fx-for-wpf-8-1.aspx</id><published>2009-11-18T14:22:29Z</published><updated>2009-11-18T14:22:29Z</updated><content type="html">&lt;p&gt;Chart FX for WPF 8.1 represents the next evolutionary step on our WPF charting tool, soon after 8.0 was released we branched out and started working on several features that either had to be cut from 8.0 because of the schedule or have been suggested by customer feedback. This post will serve as a centralized FAQ for this release.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Q. Release Date&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;The current plan is to release an open beta in the December/January timeframe, if you participated in the 8.0 beta don’t worry as we expect this beta program to be much shorter.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Q. Licensing&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Licensing has not been formally established yet but it is very likely it will be a free upgrade.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Q. Migration&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;We expect that all projects using 8.0 will compile with no change.&lt;/p&gt;  &lt;p&gt;8.1 and 8.0 can coexist on the same machine but because we use the same assembly names, they cannot be used simultaneously in the same app.    &lt;/p&gt;&lt;img src="http://community.softwarefx.com/aggbug.aspx?PostID=26418" width="1" height="1"&gt;</content><author><name>JuanC</name><uri>http://community.softwarefx.com/members/JuanC.aspx</uri></author><category term="8.1" scheme="http://community.softwarefx.com/blogs/wpf/archive/tags/8.1/default.aspx" /></entry><entry><title>Drawing a WPF visual clipped by a rounded border</title><link rel="alternate" type="text/html" href="http://community.softwarefx.com/blogs/wpf/archive/2009/10/25/drawing-a-wpf-visual-clipped-by-a-rounded-border.aspx" /><id>http://community.softwarefx.com/blogs/wpf/archive/2009/10/25/drawing-a-wpf-visual-clipped-by-a-rounded-border.aspx</id><published>2009-10-26T02:43:00Z</published><updated>2009-10-26T02:43:00Z</updated><content type="html">&lt;p&gt;Sometimes we write small classes to be used in the chart context but they could be useful in other scenarios. RoundClipBorder is one of these classes, it derives from Border but it will clip its content using a rounded border. Let’s see what happens if you try a regular WPF border around a rectangular object&lt;/p&gt;&lt;pre class="code"&gt;&lt;span style="COLOR:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Border &lt;/span&gt;&lt;span style="COLOR:red;"&gt;CornerRadius&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;5&amp;quot; &lt;/span&gt;&lt;span style="COLOR:red;"&gt;BorderBrush&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;Black&amp;quot; &lt;/span&gt;&lt;span style="COLOR:red;"&gt;BorderThickness&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;2&amp;quot;&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
  &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Image &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Source&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;pack://siteoforigin:,,,/img/US.png&amp;quot;&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;/&amp;gt;
&amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Border&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class="code"&gt;&lt;span style="COLOR:blue;"&gt;&lt;a href="http://community.softwarefx.com/blogs/wpf/RoundClip1_21D8BB8F.png"&gt;&lt;img style="BORDER-BOTTOM:0px;BORDER-LEFT:0px;DISPLAY:inline;BORDER-TOP:0px;BORDER-RIGHT:0px;" title="RoundClip1" border="0" alt="RoundClip1" src="http://community.softwarefx.com/blogs/wpf/RoundClip1_thumb_17B3F497.png" width="240" height="125" /&gt;&lt;/a&gt; &lt;/span&gt;&lt;/pre&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;
&lt;p&gt;It actually looks very nice so you are probably wondering what all the fuss is about, if you look really closely the borders are thinner around the corners, let’s see what happens if we increase the CornerRadius to a bigger size.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://community.softwarefx.com/blogs/wpf/RoundClip2_75E81C05.png"&gt;&lt;img style="BORDER-BOTTOM:0px;BORDER-LEFT:0px;DISPLAY:inline;BORDER-TOP:0px;BORDER-RIGHT:0px;" title="RoundClip2" border="0" alt="RoundClip2" src="http://community.softwarefx.com/blogs/wpf/RoundClip2_thumb_52D7AA95.png" width="240" height="121" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;Now you can clearly see what is going on, WPF is drawing the content and then drawing a rounded rectangle around it but its corners are getting into the content and what looked like a small thinner-around-the-corners issue has now turned into an overflow. RoundClipBorder works around this issue by creating a geometry and then clipping its child.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;pre class="code"&gt;&lt;span style="COLOR:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfxControls&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;RoundClipBorder &lt;/span&gt;&lt;span style="COLOR:red;"&gt;CornerRadius&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;12&amp;quot;&lt;br /&gt;                                             &lt;/span&gt;&lt;span style="COLOR:red;"&gt;BorderBrush&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;Black&amp;quot; &lt;/span&gt;&lt;span style="COLOR:red;"&gt;BorderThickness&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;2&amp;quot;&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
  &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Image &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Source&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;pack://siteoforigin:,,,/img/US.png&amp;quot;&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;/&amp;gt;
&amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfxControls&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;RoundClipBorder&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;

&lt;a href="http://community.softwarefx.com/blogs/wpf/RoundClip3_4A07A249.png"&gt;&lt;img style="BORDER-BOTTOM:0px;BORDER-LEFT:0px;DISPLAY:inline;BORDER-TOP:0px;BORDER-RIGHT:0px;" title="RoundClip3" border="0" alt="RoundClip3" src="http://community.softwarefx.com/blogs/wpf/RoundClip3_thumb_46A60AA1.png" width="240" height="121" /&gt;&lt;/a&gt; &lt;/span&gt;&lt;/pre&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;
&lt;p&gt;This class lives in the ChartFX.WPF.Controls assembly so you might have to add a reference to it in your project, if you are wondering why we created this class let me show you how our design time wizard allows you to bind data to the chart and then customize the chart tooltips to display rich content in your data.&lt;/p&gt;&lt;pre class="code"&gt;&lt;span style="COLOR:blue;"&gt;public class &lt;/span&gt;&lt;span style="COLOR:#2b91af;"&gt;CountryData
&lt;/span&gt;{
    &lt;span style="COLOR:blue;"&gt;public string &lt;/span&gt;Name { &lt;span style="COLOR:blue;"&gt;get&lt;/span&gt;; &lt;span style="COLOR:blue;"&gt;set&lt;/span&gt;; }
    &lt;span style="COLOR:blue;"&gt;public double &lt;/span&gt;Population { &lt;span style="COLOR:blue;"&gt;get&lt;/span&gt;; &lt;span style="COLOR:blue;"&gt;set&lt;/span&gt;; }
    &lt;span style="COLOR:blue;"&gt;public string &lt;/span&gt;Language { &lt;span style="COLOR:blue;"&gt;get&lt;/span&gt;; &lt;span style="COLOR:blue;"&gt;set&lt;/span&gt;; }
    &lt;span style="COLOR:blue;"&gt;public string &lt;/span&gt;Flag { &lt;span style="COLOR:blue;"&gt;get&lt;/span&gt;; &lt;span style="COLOR:blue;"&gt;set&lt;/span&gt;; }
    &lt;span style="COLOR:blue;"&gt;public double &lt;/span&gt;Sales { &lt;span style="COLOR:blue;"&gt;get&lt;/span&gt;; &lt;span style="COLOR:blue;"&gt;set&lt;/span&gt;;}
}&lt;/pre&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;&lt;pre class="code"&gt;&lt;span style="COLOR:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Window.Resources&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
  &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;ObjectDataProvider &lt;/span&gt;&lt;span style="COLOR:red;"&gt;x&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:red;"&gt;Key&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;countryData&amp;quot;&lt;br /&gt;                      &lt;/span&gt;&lt;span style="COLOR:red;"&gt;ObjectType&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;{&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;x&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Type &lt;/span&gt;&lt;span style="COLOR:red;"&gt;localData&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:red;"&gt;CountrySalesList&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;}&amp;quot; /&amp;gt;
&amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Window.Resources&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Grid&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
  &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;ChartFX&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Chart&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
  &amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;ChartFX&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Chart&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
&amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Grid&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;
&lt;p&gt;First step, let’s bind the chart to the object data provider in our page and pick the fields to be used in the plot and labels, to do this we start the chart wizard and select Configure Data&lt;/p&gt;
&lt;p&gt;&lt;a href="http://community.softwarefx.com/blogs/wpf/RoundClip4_52C784C8.png"&gt;&lt;img style="BORDER-BOTTOM:0px;BORDER-LEFT:0px;DISPLAY:inline;BORDER-TOP:0px;BORDER-RIGHT:0px;" title="RoundClip4" border="0" alt="RoundClip4" src="http://community.softwarefx.com/blogs/wpf/RoundClip4_thumb_5DE0E945.png" width="240" height="160" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;Now let’s configure the chart tooltips to display other data for the selected item, in the wizard we will now select Tooltips, after selecting all available fields in a similar page we get prompted for our tooltip configuration&lt;/p&gt;
&lt;p&gt;&lt;a href="http://community.softwarefx.com/blogs/wpf/RoundClip5_22AD0D7A.png"&gt;&lt;img style="BORDER-BOTTOM:0px;BORDER-LEFT:0px;DISPLAY:inline;BORDER-TOP:0px;BORDER-RIGHT:0px;" title="RoundClip5" border="0" alt="RoundClip5" src="http://community.softwarefx.com/blogs/wpf/RoundClip5_thumb_0BBE1631.png" width="240" height="162" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;Here is where our little control gets to be used, we will select Flag as the image field and for the Effect we will choose Round Clipped&lt;/p&gt;
&lt;p&gt;&lt;a href="http://community.softwarefx.com/blogs/wpf/RoundClip6_0281DAF0.png"&gt;&lt;img style="BORDER-BOTTOM:0px;BORDER-LEFT:0px;DISPLAY:inline;BORDER-TOP:0px;BORDER-RIGHT:0px;" title="RoundClip6" border="0" alt="RoundClip6" src="http://community.softwarefx.com/blogs/wpf/RoundClip6_thumb_7A7A12C0.png" width="240" height="146" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;Click Next and Accept, run your program and you will get the following chart and tooltip&lt;/p&gt;
&lt;p&gt;&lt;a href="http://community.softwarefx.com/blogs/wpf/RoundClip7_3826FA7D.png"&gt;&lt;img style="BORDER-BOTTOM:0px;BORDER-LEFT:0px;DISPLAY:inline;BORDER-TOP:0px;BORDER-RIGHT:0px;" title="RoundClip7" border="0" alt="RoundClip7" src="http://community.softwarefx.com/blogs/wpf/RoundClip7_thumb_1867FAE8.png" width="244" height="159" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;JuanC&lt;/p&gt;&lt;img src="http://community.softwarefx.com/aggbug.aspx?PostID=26282" width="1" height="1"&gt;</content><author><name>JuanC</name><uri>http://community.softwarefx.com/members/JuanC.aspx</uri></author><category term="DesignTime" scheme="http://community.softwarefx.com/blogs/wpf/archive/tags/DesignTime/default.aspx" /></entry><entry><title>Chart FX for WPF Compatibility with VS2010 Beta 2</title><link rel="alternate" type="text/html" href="http://community.softwarefx.com/blogs/wpf/archive/2009/10/23/chart-fx-for-wpf-compatibility-with-vs2010-beta-2.aspx" /><id>http://community.softwarefx.com/blogs/wpf/archive/2009/10/23/chart-fx-for-wpf-compatibility-with-vs2010-beta-2.aspx</id><published>2009-10-23T15:20:19Z</published><updated>2009-10-23T15:20:19Z</updated><content type="html">&lt;p&gt;Just a short post to let you know that Chart FX for WPF builds 3581 and later are compatible with Visual Studio 2010 Beta 2. From now on our builds will include the following additional files in the Design folder&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;ChartFX.WPF.Design.VS2010.dll&lt;/li&gt;    &lt;li&gt;ChartFX.WPF.VisualStudio.Design.VS2010.dll&lt;/li&gt;    &lt;li&gt;ChartFX.WPF.Controls.Design.VS2010.dll&lt;/li&gt;    &lt;li&gt;ChartFX.WPF.Motifs.HandDrawn.Design.VS2010.dll&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Note that these files are only required for design time purposes, even if you do not have them (or you have an older Chart FX build) you should be able to compile your application using VS2010 Beta 2 and run it against the .NET framework 4.0.&lt;/p&gt;  &lt;p&gt;JuanC&lt;/p&gt;&lt;img src="http://community.softwarefx.com/aggbug.aspx?PostID=26277" width="1" height="1"&gt;</content><author><name>JuanC</name><uri>http://community.softwarefx.com/members/JuanC.aspx</uri></author><category term="VS2010" scheme="http://community.softwarefx.com/blogs/wpf/archive/tags/VS2010/default.aspx" /><category term="DesignTime" scheme="http://community.softwarefx.com/blogs/wpf/archive/tags/DesignTime/default.aspx" /></entry><entry><title>Transforming Data: Combining small elements into an Other category</title><link rel="alternate" type="text/html" href="http://community.softwarefx.com/blogs/wpf/archive/2009/10/03/transforming-data-combining-small-elements-into-an-other-category.aspx" /><id>http://community.softwarefx.com/blogs/wpf/archive/2009/10/03/transforming-data-combining-small-elements-into-an-other-category.aspx</id><published>2009-10-03T21:16:40Z</published><updated>2009-10-03T21:16:40Z</updated><content type="html">&lt;p&gt;Data Transforms are a somewhat hidden but very important feature in Chart FX for WPF, although in essence they are simply a class that receives an enumeration and returns another, they can make a big difference on your charts.&lt;/p&gt;  &lt;p&gt;In this post we will discuss a simple transform called the OtherTransform, this transform groups small elements into an “Other” category for example if we try to plot carbon emissions for countries in 2006 would get a chart like this&lt;/p&gt;  &lt;p&gt;&lt;a href="http://community.softwarefx.com/blogs/wpf/OtherTransform1_75189FB4.png"&gt;&lt;img style="border-bottom:0px;border-left:0px;display:inline;border-top:0px;border-right:0px;" title="OtherTransform1" border="0" alt="OtherTransform1" src="http://community.softwarefx.com/blogs/wpf/OtherTransform1_thumb_095E19A6.png" width="240" height="142" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Note that even though we limited the data to countries that contribute more than 0.5% that still results in about 30 countries which makes the chart hard to read. If we use the OtherTransform then we get the following&lt;/p&gt;  &lt;pre class="code"&gt;      &lt;span style="color:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="color:blue;"&gt;:&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Chart.DataTransforms&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;
        &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;cfxData&lt;/span&gt;&lt;span style="color:blue;"&gt;:&lt;/span&gt;&lt;span style="color:#a31515;"&gt;OtherTransform&lt;/span&gt;&lt;span style="color:blue;"&gt;/&amp;gt;
      &amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="color:blue;"&gt;:&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Chart.DataTransforms&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;
&lt;/span&gt;&lt;/pre&gt;
&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;

&lt;p&gt;&lt;a href="http://community.softwarefx.com/blogs/wpf/OtherTransform2_7177327F.png"&gt;&lt;img style="border-bottom:0px;border-left:0px;display:inline;border-top:0px;border-right:0px;" title="OtherTransform2" border="0" alt="OtherTransform2" src="http://community.softwarefx.com/blogs/wpf/OtherTransform2_thumb_4F9B3421.png" width="240" height="142" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;With a smaller number of slices we can even show the Point Labels which would not have looked good in the first chart because of the size of the slices. By default the other transform will group all values less than 5% into the “Other” bucket but you can customize this behavior using the MinPercentage property.&lt;/p&gt;

&lt;p&gt;There is another advantage on using the OtherTransform instead of limiting how you retrieve your data, because we know the items represented in Other we can show a different tooltip with details for these items. We also switch our tooltip behavior to allow you to scroll through the elements in the itemscontrol, normally tooltips will disable all child elements so we use a home-grown tooltip implementation to support this.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://community.softwarefx.com/blogs/wpf/OtherTransform3_7373E5AE.png"&gt;&lt;img style="border-bottom:0px;border-left:0px;display:inline;border-top:0px;border-right:0px;" title="OtherTransform3" border="0" alt="OtherTransform3" src="http://community.softwarefx.com/blogs/wpf/OtherTransform3_thumb_63747B1D.png" width="240" height="141" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;We wanted this transform to be enabled by default in Pie, Doughnut and other gallery types used to display percentages, unfortunately we did not have enough time to make it work with multiple series for this release (to ship is to choose). We expect to add support for multiple series in future versions/builds.&lt;/p&gt;

&lt;p&gt;JuanC&lt;/p&gt;&lt;img src="http://community.softwarefx.com/aggbug.aspx?PostID=26162" width="1" height="1"&gt;</content><author><name>JuanC</name><uri>http://community.softwarefx.com/members/JuanC.aspx</uri></author><category term="Data Transform" scheme="http://community.softwarefx.com/blogs/wpf/archive/tags/Data+Transform/default.aspx" /></entry><entry><title>Minimize the chart legend space by showing it as a title</title><link rel="alternate" type="text/html" href="http://community.softwarefx.com/blogs/wpf/archive/2009/09/21/minimize-the-chart-legend-space-by-showing-it-as-a-title.aspx" /><id>http://community.softwarefx.com/blogs/wpf/archive/2009/09/21/minimize-the-chart-legend-space-by-showing-it-as-a-title.aspx</id><published>2009-09-21T14:10:00Z</published><updated>2009-09-21T14:10:00Z</updated><content type="html">&lt;p&gt;Sometimes the size available to a chart imposes a restriction where the legend just takes too much space. In this post we will discuss a couple of possibilities on how to approach this problem&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Style your title to mimic a legend&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;In Chart FX for WPF titles are fully stylable and although typically titles are just strings, you can in fact use any WPF visuals in the title. The problem with this approach is that you would have to code too much information into the title, for example the number of series, colors, etc. which makes this scenario not practical. Also note that things like highlight would not work.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Show the legend underneath the title&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Just removing the legend box border and docking the legend box to the top might be sufficient in many scenarios&lt;/p&gt;&lt;pre class="code"&gt;&lt;span style="COLOR:blue;"&gt;&lt;font color="#333333"&gt;  &lt;/font&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Chart.Titles&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
    &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Title&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Sales in 1998&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Title&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
  &amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Chart.Titles&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
  &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Chart.LegendBox&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
    &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;LegendBox &lt;/span&gt;&lt;span style="COLOR:red;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:red;"&gt;Chart.DockBorder&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;None&amp;quot; &lt;/span&gt;&lt;span style="COLOR:red;"&gt;DockPanel.Dock&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;Top&amp;quot; /&amp;gt;
  &amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Chart.LegendBox&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
&lt;/span&gt;&lt;/pre&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;
&lt;p&gt;&lt;a href="http://community.softwarefx.com/blogs/wpf/LegendTitle1_60C18B10.png"&gt;&lt;img style="BORDER-BOTTOM:0px;BORDER-LEFT:0px;DISPLAY:inline;BORDER-TOP:0px;BORDER-RIGHT:0px;" title="LegendTitle1" border="0" alt="LegendTitle1" src="http://community.softwarefx.com/blogs/wpf/LegendTitle1_thumb_2DF1849C.png" width="244" height="168" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;Note that in our default style (Glass) the main title is drawn larger and outside the plotting area space, if you would rather have them both together you can change the target panel of the legend box, note that in older builds we did not support a way to specify the index so you might need an updated build if this does not generate the expected results&lt;/p&gt;&lt;pre class="code"&gt;  &lt;span style="COLOR:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Chart.LegendBox&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
    &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;LegendBox &lt;/span&gt;&lt;span style="COLOR:red;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:red;"&gt;Chart.DockBorder&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;None&amp;quot; &lt;/span&gt;&lt;span style="COLOR:red;"&gt;DockPanel.Dock&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;Top&amp;quot;&lt;br /&gt;                   &lt;/span&gt;&lt;span style="COLOR:red;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:red;"&gt;Chart.TargetPanel&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;Titles-0&amp;quot; /&amp;gt;
  &amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Chart.LegendBox&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;
&lt;p&gt;&lt;a href="http://community.softwarefx.com/blogs/wpf/LegendTitle2_5F7CF231.png"&gt;&lt;img style="BORDER-BOTTOM:0px;BORDER-LEFT:0px;DISPLAY:inline;BORDER-TOP:0px;BORDER-RIGHT:0px;" title="LegendTitle2" border="0" alt="LegendTitle2" src="http://community.softwarefx.com/blogs/wpf/LegendTitle2_thumb_7EBF9904.png" width="244" height="168" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Combine the title and legend in one line&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;If the number of series is small we might be able to combine the title text and legend box in one line. To do this we will have to style the legend box and items so it will be a little more involved, hopefully the result will be worthwhile.&lt;/p&gt;&lt;pre class="code"&gt;&lt;span style="COLOR:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Style &lt;/span&gt;&lt;span style="COLOR:red;"&gt;x&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:red;"&gt;Key&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;LegendTitleStyle&amp;quot; &lt;/span&gt;&lt;span style="COLOR:red;"&gt;TargetType&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;{&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;x&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Type &lt;/span&gt;&lt;span style="COLOR:red;"&gt;ItemsControl&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;}&amp;quot;&amp;gt;
  &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Setter &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Property&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;Template&amp;quot;&amp;gt;
    &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Setter.Value&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
      &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;ControlTemplate&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
        &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;StackPanel &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Orientation&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;Horizontal&amp;quot;&amp;gt;
          &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;StackPanel &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Orientation&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;Horizontal&amp;quot; &lt;/span&gt;&lt;span style="COLOR:red;"&gt;IsItemsHost&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;True&amp;quot;&lt;br /&gt;                              &lt;/span&gt;&lt;span style="COLOR:red;"&gt;VerticalAlignment&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;Top&amp;quot; /&amp;gt;
          &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;TextBlock &lt;/span&gt;&lt;span style="COLOR:red;"&gt;VerticalAlignment&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;Top&amp;quot; &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Text&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;{&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Binding &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Path&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=Tag}&amp;quot;/&amp;gt;
        &amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;StackPanel&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
      &amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;ControlTemplate&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
    &amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Setter.Value&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
  &amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Setter&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
&amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Style&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;DataTemplate &lt;/span&gt;&lt;span style="COLOR:red;"&gt;x&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:red;"&gt;Key&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;LegendTitleItem&amp;quot;&amp;gt;
  &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;StackPanel &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Orientation&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;Horizontal&amp;quot;&amp;gt;
    &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;StackPanel.Resources&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
      &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfxConverters&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;BoolToVisibilityConverter &lt;/span&gt;&lt;span style="COLOR:red;"&gt;x&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:red;"&gt;Key&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;BoolToVisibility&amp;quot;/&amp;gt;
    &amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;StackPanel.Resources&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
    &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;StackPanel &lt;/span&gt;&lt;span style="COLOR:red;"&gt;VerticalAlignment&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;Top&amp;quot; &lt;/span&gt;&lt;span style="COLOR:red;"&gt;x&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:red;"&gt;Name&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;textAndLine&amp;quot;&amp;gt;
      &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Border &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Background&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;Transparent&amp;quot;&amp;gt;
        &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;ContentControl &lt;/span&gt;&lt;span style="COLOR:red;"&gt;IsHitTestVisible&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;false&amp;quot; &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Content&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;{&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Binding &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Path&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=Content}&amp;quot;&lt;br /&gt;                        &lt;/span&gt;&lt;span style="COLOR:red;"&gt;ContentTemplate&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;{&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Binding &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Path&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=ContentTemplate}&amp;quot;&lt;br /&gt;                        &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Foreground&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;{&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Binding &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Path&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=Foreground}&amp;quot;&lt;br /&gt;                        &lt;/span&gt;&lt;span style="COLOR:red;"&gt;FontFamily&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;{&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Binding &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Path&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=FontFamily}&amp;quot;&lt;br /&gt;                        &lt;/span&gt;&lt;span style="COLOR:red;"&gt;FontSize&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;{&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Binding &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Path&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=FontSize}&amp;quot;&lt;br /&gt;                        &lt;/span&gt;&lt;span style="COLOR:red;"&gt;FontStyle&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;{&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Binding &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Path&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=FontStyle}&amp;quot;&lt;br /&gt;                        &lt;/span&gt;&lt;span style="COLOR:red;"&gt;FontWeight&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;{&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Binding &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Path&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=FontWeight}&amp;quot;/&amp;gt;
      &amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Border&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
      &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Rectangle &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Fill&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;{&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Binding &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Path&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=Stroke}&amp;quot; &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Height&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;3&amp;quot;/&amp;gt;
    &amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;StackPanel&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
    &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;TextBlock &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Text&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot; &amp;quot;/&amp;gt; 
    &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;TextBlock &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Text&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;Vs &amp;quot; &lt;/span&gt;&lt;span style="COLOR:red;"&gt;IsHitTestVisible&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;false&amp;quot;&lt;br /&gt;               &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Visibility&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;{&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Binding &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Path&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=LastInGroup,&lt;br /&gt;                            &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Converter&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;={&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;StaticResource &lt;/span&gt;&lt;span style="COLOR:red;"&gt;BoolToVisibility&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;},&lt;br /&gt;                            &lt;/span&gt;&lt;span style="COLOR:red;"&gt;ConverterParameter&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=false}&amp;quot;/&amp;gt;
  &amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;StackPanel&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
  &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;DataTemplate.Triggers&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
    &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;DataTrigger &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Binding&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;{&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Binding &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Path&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=Dimmed}&amp;quot;&amp;gt;
      &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;DataTrigger.Value&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
        &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;sys&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Boolean&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;True&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;sys&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Boolean&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
      &amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;DataTrigger.Value&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
      &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Setter &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Property&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;Opacity&amp;quot; &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Value&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;0.25&amp;quot; &lt;/span&gt;&lt;span style="COLOR:red;"&gt;TargetName&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;textAndLine&amp;quot; /&amp;gt;
    &amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;DataTrigger&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
  &amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;DataTemplate.Triggers&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
&amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;DataTemplate&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class="code"&gt;  &lt;span style="COLOR:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Chart.LegendBox&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
    &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;LegendBox &lt;/span&gt;&lt;span style="COLOR:red;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:red;"&gt;Chart.DockBorder&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;None&amp;quot; &lt;/span&gt;&lt;span style="COLOR:red;"&gt;DockPanel.Dock&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;Top&amp;quot;&lt;br /&gt;                   &lt;span style="COLOR:red;"&gt;Tag&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;Sales in 1998&amp;quot;&lt;br /&gt;                   &lt;/span&gt;&lt;/span&gt;&lt;span style="COLOR:red;"&gt;ContainerStyle&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;{&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;StaticResource &lt;/span&gt;&lt;span style="COLOR:red;"&gt;LegendTitleStyle&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;}&amp;quot;&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
      &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;LegendBox.ItemAttributes&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
        &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;LegendItemAttributes &lt;/span&gt;&lt;span style="COLOR:red;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:red;"&gt;LegendItemAttributes.LegendItemType&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;Series&amp;quot;&lt;br /&gt;                                  &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Template&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;{&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;StaticResource &lt;/span&gt;&lt;span style="COLOR:red;"&gt;LegendTitleItem&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;}&amp;quot;/&amp;gt;
      &amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;LegendBox.ItemAttributes&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
    &amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;LegendBox&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
  &amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Chart.LegendBox&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;&lt;a href="http://community.softwarefx.com/blogs/wpf/LegendTitle3_7E53660F.png"&gt;&lt;img style="BORDER-BOTTOM:0px;BORDER-LEFT:0px;DISPLAY:inline;BORDER-TOP:0px;BORDER-RIGHT:0px;" title="LegendTitle3" border="0" alt="LegendTitle3" src="http://community.softwarefx.com/blogs/wpf/LegendTitle3_thumb_32878F56.png" width="244" height="168" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;Key points from the XAML&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;In LegendTitleStyle we set a template that has a horizontal stack panel (legend items) + the legend Tag, this allows to reuse this style as all we have to change is the LegendBox tag property. &lt;br /&gt;&lt;/li&gt;
&lt;li&gt;In LegendTitleItem we are showing the legend content with a line under it that uses the series stroke instead of fill, this makes the line a little darker. &lt;br /&gt;&lt;/li&gt;
&lt;li&gt;To hide the separator text (Vs) we used a ChartFX converter because it allows us to set Visibility to Collapsed when the bool property (LastInGroup) is true by setting ConverterParameter to false. The built-in BooleanToVisibilityConverter only seems to convert True to Visible. &lt;br /&gt;&lt;/li&gt;
&lt;li&gt;By using a ContentControl instead of a TextBlock our template should work even if you use Series.ContentTemplate to a more complex visual. &lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;Please note that the legend box can show much more than just the series as it can display information about conditional attributes, axis sections, axis custom gridlines, etc. but in simple scenarios this approach generates a simpler chart while still providing contextual information to your users.&lt;/p&gt;
&lt;p&gt;JuanC&lt;/p&gt;&lt;img src="http://community.softwarefx.com/aggbug.aspx?PostID=26093" width="1" height="1"&gt;</content><author><name>JuanC</name><uri>http://community.softwarefx.com/members/JuanC.aspx</uri></author><category term="LegendBox" scheme="http://community.softwarefx.com/blogs/wpf/archive/tags/LegendBox/default.aspx" /><category term="Styling" scheme="http://community.softwarefx.com/blogs/wpf/archive/tags/Styling/default.aspx" /><category term="Title" scheme="http://community.softwarefx.com/blogs/wpf/archive/tags/Title/default.aspx" /></entry><entry><title>Creating Win/Loss charts in WPF</title><link rel="alternate" type="text/html" href="http://community.softwarefx.com/blogs/wpf/archive/2009/09/15/creating-win-loss-charts-in-wpf.aspx" /><id>http://community.softwarefx.com/blogs/wpf/archive/2009/09/15/creating-win-loss-charts-in-wpf.aspx</id><published>2009-09-15T04:00:00Z</published><updated>2009-09-15T04:00:00Z</updated><content type="html">&lt;p&gt;Although Win/Loss charts can obviously be used to display win/loss/tie records they are also being increasingly used in dashboard scenarios to show a collection of values where there is a binary condition and you want to quickly see which values met such condition, e.g. to display a list of several products where you plot sales per month and want to easily see if the sales quota was met. &lt;/p&gt;
&lt;p&gt;We will use as a sample and starting point a sparkline chart we created in &lt;a href="http://community.softwarefx.com/blogs/wpf/archive/2009/05/22/minimizing-ink.aspx" target="_blank"&gt;this post&lt;/a&gt;, but will change the gallery to WinLoss and make sure we specify a goal for each product. If you do not specify a goal we will use 0 if there are positive and negative values or half the range if all values are positive/negative.&lt;/p&gt;&lt;pre class="code"&gt;&lt;span style="COLOR:blue;"&gt;  &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Chart.AllSeries&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
    &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;AllSeriesAttributes&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
      &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;AllSeriesAttributes.GalleryAttributes&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
        &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfxwinloss&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;WinLoss &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Goal&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;30&amp;quot; /&amp;gt;
      &amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;AllSeriesAttributes.GalleryAttributes&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
    &amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;AllSeriesAttributes&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
  &amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Chart.AllSeries&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
&lt;/span&gt;&lt;/pre&gt;&lt;pre class="code"&gt;&lt;a href="http://community.softwarefx.com/blogs/wpf/WinLoss1_0F663DCB.png"&gt;&lt;img style="BORDER-BOTTOM:0px;BORDER-LEFT:0px;DISPLAY:inline;BORDER-TOP:0px;BORDER-RIGHT:0px;" title="WinLoss1" border="0" alt="WinLoss1" src="http://community.softwarefx.com/blogs/wpf/WinLoss1_thumb_4EC3F15B.png" width="244" height="107" /&gt;&lt;/a&gt; &lt;/pre&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;
&lt;p&gt;The WinLoss gallery will try to choose a couple of colors in the current palette close to red and blue but you can assign precise colors by using the LossFill, LossStroke, WinFill and WinStroke properties. Additionally we can use ConditionalAttributes to color the biggest and smallest value, note that we use the AndCondition and MaximumValueCondition from the ChartFX.Data assembly, we use the AndCondition to make sure we only mark the biggest/smallest value if it was greater/smaller than the goal.&lt;/p&gt;&lt;pre class="code"&gt;  &lt;span style="COLOR:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Chart.AllSeries&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
    &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;AllSeriesAttributes&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
      &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;AllSeriesAttributes.GalleryAttributes&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
        &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfxwinloss&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;WinLoss &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Goal&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;30&amp;quot;&lt;br /&gt;                            &lt;/span&gt;&lt;span style="COLOR:red;"&gt;LossFill&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;#FF8B89&amp;quot; &lt;/span&gt;&lt;span style="COLOR:red;"&gt;LossStroke&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;#FF8B89&amp;quot;&lt;br /&gt;                            &lt;/span&gt;&lt;span style="COLOR:red;"&gt;WinFill&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;#909090&amp;quot; &lt;/span&gt;&lt;span style="COLOR:red;"&gt;WinStroke&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;#909090&amp;quot;/&amp;gt;
      &amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;AllSeriesAttributes.GalleryAttributes&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
    &amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;AllSeriesAttributes&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
  &amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Chart.AllSeries&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
  &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Chart.ConditionalAttributes&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
    &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;ConditionalAttributes &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Fill&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;#007010&amp;quot; &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Stroke&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;#007010&amp;quot;&amp;gt;
      &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;ConditionalAttributes.Condition&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
        &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfxData&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;AndCondition&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
          &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;RangeCondition &lt;/span&gt;&lt;span style="COLOR:red;"&gt;From&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;30&amp;quot;/&amp;gt;
          &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfxData&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;MaximumValueCondition&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;/&amp;gt;
        &amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfxData&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;AndCondition&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
      &amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;ConditionalAttributes.Condition&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
    &amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;ConditionalAttributes&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
    &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;ConditionalAttributes &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Fill&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;Red&amp;quot; &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Stroke&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;Red&amp;quot;&amp;gt;
      &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;ConditionalAttributes.Condition&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
        &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfxData&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;AndCondition&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
          &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;RangeCondition &lt;/span&gt;&lt;span style="COLOR:red;"&gt;To&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;30&amp;quot;/&amp;gt;
          &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfxData&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;MinimumValueCondition&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;/&amp;gt;
        &amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfxData&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;AndCondition&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
      &amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;ConditionalAttributes.Condition&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
    &amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;ConditionalAttributes&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
  &amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Chart.ConditionalAttributes&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://community.softwarefx.com/blogs/wpf/WinLoss2_46CC4EF9.png"&gt;&lt;img style="BORDER-BOTTOM:0px;BORDER-LEFT:0px;DISPLAY:inline;BORDER-TOP:0px;BORDER-RIGHT:0px;" title="WinLoss2" border="0" alt="WinLoss2" src="http://community.softwarefx.com/blogs/wpf/WinLoss2_thumb_744D6EBC.png" width="244" height="107" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;Finally, we will use WinLoss to show a new feature implemented in Chart FX for WPF which is also useful in bar charts when because of chart size, number of points or the combination of both generates thin bars, the issue is that we calculate sizes and positions using doubles, this allows WPF zoom and pixel independent architecture to work as expected but might generate an issue where the space between the bars is clearly not constant. For example if we now switch to 24 points per product and set the chart size to 120 pixels we might get something like this&lt;/p&gt;
&lt;p&gt;&lt;a href="http://community.softwarefx.com/blogs/wpf/WinLoss3_179A6362.png"&gt;&lt;img style="BORDER-BOTTOM:0px;BORDER-LEFT:0px;DISPLAY:inline;BORDER-TOP:0px;BORDER-RIGHT:0px;" title="WinLoss3" border="0" alt="WinLoss3" src="http://community.softwarefx.com/blogs/wpf/WinLoss3_thumb_451B8325.png" width="282" height="135" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;A new property in PlotArea called PixelSnapMethod now supports three values:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;None: Default value which uses double for all operations&lt;/li&gt;
&lt;li&gt;Full: We make sure that the size of the bars and the space between them is constant, note that this might generate white space to the sides of the chart.&lt;/li&gt;
&lt;li&gt;Marker: Space between bars is kept constant but size of the markers might vary slightly, this approach will not suffer from the same white space issue when using Full &lt;/li&gt;&lt;/ul&gt;&lt;pre class="code"&gt;  &lt;span style="COLOR:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Chart.PlotArea&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
    &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;PlotAreaAttributes &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Margin&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;0&amp;quot; &lt;/span&gt;&lt;span style="COLOR:red;"&gt;AxesStyle&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;None&amp;quot;&lt;br /&gt;                            &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Background&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;{&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;x&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Null&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;}&amp;quot; &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Stroke&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;{&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;x&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Null&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;}&amp;quot;&lt;br /&gt;                            &lt;/span&gt;&lt;span style="COLOR:red;"&gt;PixelSnapMethod&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;Full&amp;quot;/&amp;gt;
  &amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Chart.PlotArea&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;
&lt;p&gt;&lt;a href="http://community.softwarefx.com/blogs/wpf/WinLoss4_3D9013B8.png"&gt;&lt;img style="BORDER-BOTTOM:0px;BORDER-LEFT:0px;DISPLAY:inline;BORDER-TOP:0px;BORDER-RIGHT:0px;" title="WinLoss4" border="0" alt="WinLoss4" src="http://community.softwarefx.com/blogs/wpf/WinLoss4_thumb_6B11337B.png" width="282" height="135" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;You can see all bars and white spaces sizes have been rounded to integers but because the number of pixels was not evenly divisible by the number of points there is some wasted space around the chart, if you switch PixelSnapMethod to Marker we will only make sure all spaces are the same, by making some bars wider than others it will not generate the empty areas around the plot area. Note that even though in this sample the space wasted by the Full method is not too bad, it could increase as the number of points increase.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://community.softwarefx.com/blogs/wpf/WinLoss5_35987156.png"&gt;&lt;img style="BORDER-BOTTOM:0px;BORDER-LEFT:0px;DISPLAY:inline;BORDER-TOP:0px;BORDER-RIGHT:0px;" title="WinLoss5" border="0" alt="WinLoss5" src="http://community.softwarefx.com/blogs/wpf/WinLoss5_thumb_352C3E61.png" width="282" height="134" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;JuanC&lt;/p&gt;&lt;img src="http://community.softwarefx.com/aggbug.aspx?PostID=26060" width="1" height="1"&gt;</content><author><name>JuanC</name><uri>http://community.softwarefx.com/members/JuanC.aspx</uri></author><category term="Gallery" scheme="http://community.softwarefx.com/blogs/wpf/archive/tags/Gallery/default.aspx" /><category term="Sparkline" scheme="http://community.softwarefx.com/blogs/wpf/archive/tags/Sparkline/default.aspx" /><category term="WinLoss" scheme="http://community.softwarefx.com/blogs/wpf/archive/tags/WinLoss/default.aspx" /></entry><entry><title>Gallery types supported in Chart FX for WPF</title><link rel="alternate" type="text/html" href="http://community.softwarefx.com/blogs/wpf/archive/2009/09/11/gallery-types-supported-in-chart-fx-for-wpf.aspx" /><id>http://community.softwarefx.com/blogs/wpf/archive/2009/09/11/gallery-types-supported-in-chart-fx-for-wpf.aspx</id><published>2009-09-11T19:15:00Z</published><updated>2009-09-11T19:15:00Z</updated><content type="html">&lt;p&gt;In Chart FX for WPF we try to support the most common gallery types in our core DLL (ChartFX.WPF.dll) but at the same time we want to be very agile supporting additional gallery types, we do this in separate satellite assemblies which allows us to keep our library at a reasonable size but still allowing users to easily create other not-so-common gallery types.&lt;/p&gt;
&lt;p&gt;If you check the Gallery enumeration which is the list of gallery types we support in our core dll, you will find the following galleries:&lt;/p&gt;&lt;pre class="code"&gt;&lt;span style="COLOR:blue;"&gt;&lt;font size="2" face="Lucida Console"&gt;public enum &lt;/font&gt;&lt;/span&gt;&lt;font size="2"&gt;&lt;font face="Lucida Console"&gt;&lt;span style="COLOR:#2b91af;"&gt;Gallery
&lt;/span&gt;{
    Bar,
    Area,
    Line,
    Curve,
    Pie,
    Scatter,
    Bubble,
    Radar,
    Polar,
    Doughnut,
    Gantt,
    OpenHighLowClose,
    Candlestick,
    HighLowClose,
    TreeMap,
    CurveArea,
    Step,
    Pyramid,
    Cube,
    Funnel,
    Surface,
}
&lt;/font&gt;&lt;/font&gt;&lt;/pre&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;
&lt;p&gt;Note that we use gallery type in a strict sense, so we are not counting here any variations such as stacked/stacked100, 2D/3D, etc, the galleries will try to honor as many of these common properties as possible. Also note that each gallery in the enumeration is backed up by a class and sometimes these classes will expose additional properties, for example when you create a Radar chart you will get lines connecting the points but you can also paint the area as follows&lt;/p&gt;&lt;pre class="code"&gt;  &lt;span style="COLOR:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Chart.AllSeries&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
    &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;AllSeriesAttributes&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
      &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;AllSeriesAttributes.GalleryAttributes&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
        &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfxGalleries&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Radar &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Gallery&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;Area&amp;quot;/&amp;gt;
      &amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;AllSeriesAttributes.GalleryAttributes&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
    &amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;AllSeriesAttributes&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
  &amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Chart.AllSeries&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
&lt;/span&gt;&lt;/pre&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;
&lt;p&gt;&lt;a href="http://community.softwarefx.com/blogs/wpf/Gallery1_5860ED82.png"&gt;&lt;img style="BORDER-BOTTOM:0px;BORDER-LEFT:0px;DISPLAY:inline;BORDER-TOP:0px;BORDER-RIGHT:0px;" title="Gallery1" border="0" alt="Gallery1" src="http://community.softwarefx.com/blogs/wpf/Gallery1_thumb_49B6419D.png" width="240" height="191" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;Other classes also add interesting functionality, the Bar class allows bar charts to use X values, the Pie class allows you to create 3D pie charts where the height of each slice depends on another variable, etc. You can also set the GalleryAttributes property on a per-series basis, which allows you to use different settings for different series in your chart.&lt;/p&gt;
&lt;p&gt;In addition to this set of built-in galleries we have developed the following assemblies that support extra gallery types&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Rose: Sometimes also called wind chart &lt;/li&gt;
&lt;li&gt;HighLow: Displays 2 series filling the area between the 2 where the color depends on which series is bigger &lt;/li&gt;
&lt;li&gt;&lt;a href="http://community.softwarefx.com/blogs/wpf/archive/2009/09/02/creating-bullet-charts-in-wpf.aspx" target="_blank"&gt;Bullet&lt;/a&gt;: Used in dashboards to compare performance against comparative measures.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://community.softwarefx.com/blogs/wpf/archive/2009/08/06/map-chart-using-surfacexyz.aspx" target="_blank"&gt;XYZ&lt;/a&gt;: Includes support for XYZ surface as well as XYZ scatter plots &lt;/li&gt;
&lt;li&gt;&lt;a href="http://community.softwarefx.com/blogs/wpf/archive/2009/09/15/creating-win-loss-charts-in-wpf.aspx" target="_blank"&gt;WinLoss&lt;/a&gt;: Used for Win/Loss records and also&amp;nbsp;show values that meet a specific condition. &lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;Using these extra gallery types is straightforward, the manual way would be to add a reference to the DLL in your project, then setting (in XAML or code) the SeriesAttributes.GalleryAttributes property to point to the class that implements the new gallery type. Our design time wizard can automate these steps if you use the gallery option&lt;/p&gt;
&lt;p&gt;&lt;a href="http://community.softwarefx.com/blogs/wpf/Gallery2_5E3B911B.png"&gt;&lt;img style="BORDER-BOTTOM:0px;BORDER-LEFT:0px;DISPLAY:inline;BORDER-TOP:0px;BORDER-RIGHT:0px;" title="Gallery2" border="0" alt="Gallery2" src="http://community.softwarefx.com/blogs/wpf/Gallery2_thumb_480575C9.png" width="244" height="137" /&gt;&lt;/a&gt;&amp;nbsp; &lt;/p&gt;
&lt;p&gt;Please note that in both Visual Studio 2008 and 2010 our wizard will automatically add the required references to your project but in Blend 3 this is not supported so you have to manually add the reference before running the wizard. We will not show external galleries (or chart styles) if the reference is not present.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;JuanC&lt;/p&gt;&lt;img src="http://community.softwarefx.com/aggbug.aspx?PostID=26049" width="1" height="1"&gt;</content><author><name>JuanC</name><uri>http://community.softwarefx.com/members/JuanC.aspx</uri></author><category term="Gallery" scheme="http://community.softwarefx.com/blogs/wpf/archive/tags/Gallery/default.aspx" /></entry><entry><title>Creating bullet charts in WPF</title><link rel="alternate" type="text/html" href="http://community.softwarefx.com/blogs/wpf/archive/2009/09/02/creating-bullet-charts-in-wpf.aspx" /><id>http://community.softwarefx.com/blogs/wpf/archive/2009/09/02/creating-bullet-charts-in-wpf.aspx</id><published>2009-09-02T14:19:00Z</published><updated>2009-09-02T14:19:00Z</updated><content type="html">&lt;p&gt;A bullet chart - designed by Stephen Few from PerceptualEdge - allows you to compare a performance measure against a comparative measure (e.g. compare year revenues against target values), optionally displaying qualitative ranges.This post will describe a new assembly to be included in Chart FX for WPF that will help you create bullet charts.&lt;/p&gt;
&lt;p&gt;This gallery requires at least 2 series, so let’s say you want to plot YTD revenues against last-year revenues, you would code your XAML as follows&lt;/p&gt;&lt;pre class="code"&gt;    &lt;span style="COLOR:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Chart &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Style&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;{&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;x&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Static &lt;/span&gt;&lt;span style="COLOR:red;"&gt;cfxMotifs&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:red;"&gt;Basic&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;.Style}&amp;quot; &lt;span style="COLOR:red;"&gt;FontFamily&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;Calibri&amp;quot;&lt;/span&gt;&lt;br /&gt;               &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Palette&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;{&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;x&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Static &lt;/span&gt;&lt;span style="COLOR:red;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:red;"&gt;Palettes&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;.Monochrome}&amp;quot;&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
      &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Chart.AllSeries&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
        &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;AllSeriesAttributes&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
          &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;AllSeriesAttributes.GalleryAttributes&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
            &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfxBullet&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Bullet&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;/&amp;gt;
          &amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;AllSeriesAttributes.GalleryAttributes&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
        &amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;AllSeriesAttributes&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
      &amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Chart.AllSeries&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
      &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Chart.ItemsSource&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
        &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Binding &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Source&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;{&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;StaticResource &lt;/span&gt;&lt;span style="COLOR:red;"&gt;MyData&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;}&amp;quot; &lt;/span&gt;&lt;span style="COLOR:red;"&gt;XPath&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;BulletData/BulletPoint&amp;quot; /&amp;gt;
      &amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Chart.ItemsSource&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
      &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Chart.Series&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
        &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;SeriesAttributesCollection&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
          &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;SeriesAttributes &lt;/span&gt;&lt;span style="COLOR:red;"&gt;BindingPath&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;@ActualRevenue&amp;quot; &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Content&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;Actual&amp;quot;/&amp;gt;
          &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;SeriesAttributes &lt;/span&gt;&lt;span style="COLOR:red;"&gt;BindingPath&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;@TargetRevenue&amp;quot; &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Content&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;Target&amp;quot;/&amp;gt;
        &amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;SeriesAttributesCollection&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
      &amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Chart.Series&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
      &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Chart.AxisX&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
        &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Axis &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Foreground&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;Black&amp;quot;&amp;gt;
          &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Axis.Labels&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
            &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;AxisLabelAttributes &lt;/span&gt;&lt;span style="COLOR:red;"&gt;BindingPath&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;@Region&amp;quot;/&amp;gt;
          &amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Axis.Labels&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
          &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Axis.Grids&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
            &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Grids&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
              &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Grids.Major&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
                &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;GridLine &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Visibility&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;Collapsed&amp;quot; &lt;/span&gt;&lt;span style="COLOR:red;"&gt;TickMark&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;None&amp;quot;/&amp;gt;
              &amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Grids.Major&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
            &amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Grids&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
          &amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Axis.Grids&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
          &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Axis.Line&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
            &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;LineAttributes &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Visibility&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;Collapsed&amp;quot;/&amp;gt;
          &amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Axis.Line&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
        &amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Axis&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
      &amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Chart.AxisX&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
      &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Chart.AxisY&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
        &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Axis&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
          &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Axis.Grids&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
            &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Grids&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
              &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Grids.Major&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
                &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;GridLine &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Visibility&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;Collapsed&amp;quot;/&amp;gt;
              &amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Grids.Major&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
            &amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Grids&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
          &amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Axis.Grids&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
        &amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Axis&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
      &amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Chart.AxisY&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
      &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Chart.PlotArea&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
        &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;PlotAreaAttributes &lt;/span&gt;&lt;span style="COLOR:red;"&gt;AxesStyle&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;Math&amp;quot; &lt;span style="COLOR:#a31515;"&gt;&lt;/span&gt;&lt;span style="COLOR:red;"&gt;ClipToBounds&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;False&amp;quot;&lt;/span&gt;/&amp;gt;
      &amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Chart.PlotArea&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;&lt;br /&gt;      &lt;span style="COLOR:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Chart.LegendBox&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;        &lt;span style="COLOR:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;LegendBox &lt;span style="COLOR:red;"&gt;Visibility&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;Collapsed&amp;quot;&lt;/span&gt;/&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;      &lt;span style="COLOR:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Chart.LegendBox&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;&lt;/span&gt;
&lt;/span&gt;&lt;span style="COLOR:green;"&gt;      &lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Chart.Titles&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
        &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Title &lt;/span&gt;&lt;span style="COLOR:red;"&gt;HorizontalAlignment&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;Left&amp;quot;&lt;br /&gt;                   &lt;/span&gt;&lt;span style="COLOR:red;"&gt;cfxControls&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:red;"&gt;SpacingDockPanel.AlignToPlotArea&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;False&amp;quot;&lt;br /&gt;                   &lt;/span&gt;&lt;span style="COLOR:red;"&gt;FontWeight&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;Bold&amp;quot; &lt;/span&gt;&lt;span style="COLOR:red;"&gt;FontSize&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;32&amp;quot; &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Margin&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;12,0,0,6&amp;quot;&amp;gt;&lt;br /&gt;              &lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Revenue YTD&lt;br /&gt;         &lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Title&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
&lt;/span&gt;&lt;span style="COLOR:green;"&gt;      &lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Chart.Titles&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
    &amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Chart&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
&lt;/span&gt;&lt;/pre&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;
&lt;p&gt;Most of the XAML here is making sure that we remove all non-essential elements including axis gridlines, borders, etc. We are also using a new palette called monochrome that tries to minimize the colors used in the chart and use darker shades for the most important pieces of data. Note that you can still use bullet charts with other styles (Glass, Simple, etc.) as well as other more colorful palettes but this feels more closer to the original intention of the design “designed to convey a rich story clearly in little space”&lt;/p&gt;
&lt;p&gt;&lt;a href="http://community.softwarefx.com/blogs/wpf/Bullet1_595BBA51.png"&gt;&lt;img style="BORDER-BOTTOM:0px;BORDER-LEFT:0px;DISPLAY:inline;BORDER-TOP:0px;BORDER-RIGHT:0px;" title="Bullet1" border="0" alt="Bullet1" src="http://community.softwarefx.com/blogs/wpf/Bullet1_thumb_71EB57A1.png" width="244" height="143" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;An interesting thing about this chart is that with the proper alignment, we can show the numerical data and give the appearance of a table that mixes numbers and multiple bullet charts, to do this we can use an stretched data view, note that we will also add a title for the plot which will increase the table effect. The new AlignToMarkers property makes sure that the values in the data view are aligned inside the plot area which means the data view headers will be drawn outside the plot area.&lt;/p&gt;&lt;pre class="code"&gt;  &lt;span style="COLOR:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Chart.DataView&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
    &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;DataView &lt;/span&gt;&lt;span style="COLOR:red;"&gt;DockBorder&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;None&amp;quot; &lt;/span&gt;&lt;span style="COLOR:red;"&gt;DockPanel.Dock&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;Right&amp;quot; &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Visibility&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;Visible&amp;quot;&lt;br /&gt;                  &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Background&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;Transparent&amp;quot; &lt;/span&gt;&lt;span style="COLOR:red;"&gt;VerticalAlignment&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;Stretch&amp;quot;&lt;br /&gt;                  &lt;/span&gt;&lt;span style="COLOR:red;"&gt;AlignToMarkers&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;True&amp;quot;&amp;gt;
      &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;DataView.Points&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
        &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;DataViewItemAttributes&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
          &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;DataViewItemAttributes.GridLines&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
            &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;GridLine &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Visibility&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;Collapsed&amp;quot;/&amp;gt;
          &amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;DataViewItemAttributes.GridLines&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
        &amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;DataViewItemAttributes&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
      &amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;DataView.Points&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
      &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;DataView.Fields&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
        &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;DataViewFieldAttributes&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
          &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;DataViewFieldAttributes.GridLines&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
            &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;GridLine &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Visibility&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;Collapsed&amp;quot;/&amp;gt;
          &amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;DataViewFieldAttributes.GridLines&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
          &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;DataViewFieldAttributes.Headers&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
            &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;FieldHeaderAttributes &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Visibility&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;Visible&amp;quot; &lt;span style="COLOR:#a31515;"&gt;&lt;/span&gt;&lt;span style="COLOR:red;"&gt;Background&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;Transparent&amp;quot;&lt;/span&gt;/&amp;gt;
          &amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;DataViewFieldAttributes.Headers&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
          &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;DataViewFieldAttributes.Items&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
            &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;SeriesField &lt;/span&gt;&lt;span style="COLOR:red;"&gt;SeriesIndex&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;0&amp;quot; &lt;/span&gt;&lt;span style="COLOR:red;"&gt;MarkerVisibility&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;Collapsed&amp;quot;/&amp;gt;
            &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;SeriesField &lt;/span&gt;&lt;span style="COLOR:red;"&gt;SeriesIndex&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;1&amp;quot; &lt;/span&gt;&lt;span style="COLOR:red;"&gt;MarkerVisibility&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;Collapsed&amp;quot;/&amp;gt;
          &amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;DataViewFieldAttributes.Items&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
        &amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;DataViewFieldAttributes&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
      &amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;DataView.Fields&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
    &amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;DataView&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
  &amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Chart.DataView&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
  &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Chart.Titles&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
    &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Title &lt;/span&gt;&lt;span style="COLOR:red;"&gt;HorizontalAlignment&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;Left&amp;quot; &lt;/span&gt;&lt;span style="COLOR:red;"&gt;cfxControls&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:red;"&gt;SpacingDockPanel.AlignToPlotArea&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;False&amp;quot;&lt;br /&gt;               &lt;/span&gt;&lt;span style="COLOR:red;"&gt;FontWeight&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;Bold&amp;quot; &lt;/span&gt;&lt;span style="COLOR:red;"&gt;FontSize&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;32&amp;quot; &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Margin&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;12,0,0,6&amp;quot;&amp;gt;&lt;br /&gt;        &lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Revenue YTD&lt;br /&gt;    &lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Title&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
    &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Title &lt;/span&gt;&lt;span style="COLOR:red;"&gt;HorizontalAlignment&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;Left&amp;quot;&amp;gt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Actual vs. Target&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Title&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
  &amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Chart.Titles&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
&lt;/span&gt;&lt;/pre&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;
&lt;p&gt;&lt;a href="http://community.softwarefx.com/blogs/wpf/Bullet2_119A316A.png"&gt;&lt;img style="BORDER-BOTTOM:0px;BORDER-LEFT:0px;DISPLAY:inline;BORDER-TOP:0px;BORDER-RIGHT:0px;" title="Bullet2" border="0" alt="Bullet2" src="http://community.softwarefx.com/blogs/wpf/Bullet2_thumb_5F365DEA.png" width="244" height="143" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;If you want to display ranges you can use the Sections property exposed by the Bullet class. In this sample we are also switching the volume for the sections and displaying both the default section colors as well as a customized version. Note that the fact that we want 3 sections means that our chart will now require 5 series so we are setting the Chart.Series collection accordingly.&lt;/p&gt;
&lt;p&gt;All volumes (Actual, Target and Section) are expressed as percentages of the space available for each bar, remember that there is also a volume property in AllSeries which defaults to 75% and this is applied first, this means that by default even if you set SectionVolume to 100 they will have some space between them unless you set AllSeries.Volume to be 100.&lt;/p&gt;&lt;pre class="code"&gt;  &lt;span style="COLOR:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfxBullet&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Bullet &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Sections&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;3&amp;quot; &lt;/span&gt;&lt;span style="COLOR:red;"&gt;SectionVolume&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;100&amp;quot; &lt;/span&gt;&lt;span style="COLOR:red;"&gt;TargetVolume&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;80&amp;quot; &lt;/span&gt;&lt;span style="COLOR:red;"&gt;ActualVolume&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;50&amp;quot; /&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;&lt;pre class="code"&gt;  &lt;span style="COLOR:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Chart.Series&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
    &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;SeriesAttributesCollection&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
      &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;SeriesAttributes &lt;/span&gt;&lt;span style="COLOR:red;"&gt;BindingPath&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;@ActualRevenue&amp;quot; &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Content&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;Actual&amp;quot;/&amp;gt;
      &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;SeriesAttributes &lt;/span&gt;&lt;span style="COLOR:red;"&gt;BindingPath&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;@TargetRevenue&amp;quot; &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Content&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;Target&amp;quot;/&amp;gt;
      &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;SeriesAttributes &lt;/span&gt;&lt;span style="COLOR:red;"&gt;BindingPath&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;@Bad&amp;quot;/&amp;gt;
      &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;SeriesAttributes &lt;/span&gt;&lt;span style="COLOR:red;"&gt;BindingPath&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;@Satisfactory&amp;quot;/&amp;gt;
      &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;SeriesAttributes &lt;/span&gt;&lt;span style="COLOR:red;"&gt;BindingPath&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;@Good&amp;quot;/&amp;gt;
    &amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;SeriesAttributesCollection&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
  &amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Chart.Series&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;&amp;nbsp;&lt;a href="http://community.softwarefx.com/blogs/wpf/Bullet3_50F7E4FA.png"&gt;&lt;img style="BORDER-BOTTOM:0px;BORDER-LEFT:0px;DISPLAY:inline;BORDER-TOP:0px;BORDER-RIGHT:0px;" title="Bullet3" border="0" alt="Bullet3" src="http://community.softwarefx.com/blogs/wpf/Bullet3_thumb_6C9C70F0.png" width="244" height="143" /&gt;&lt;/a&gt; &lt;a href="http://community.softwarefx.com/blogs/wpf/Bullet4_573EBB88.png"&gt;&lt;img style="BORDER-BOTTOM:0px;BORDER-LEFT:0px;DISPLAY:inline;BORDER-TOP:0px;BORDER-RIGHT:0px;" title="Bullet4" border="0" alt="Bullet4" src="http://community.softwarefx.com/blogs/wpf/Bullet4_thumb_1D4F789C.png" width="244" height="143" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;The image with the color sections was achieved by setting Fill and Stroke for the 3 extra series, if you do not set any colors we will use the recommended section colors in the Bullet Graph Design Spec. Finally you can plot more than 1 actual/target group, in the following chart also displayed in “Information Dashboard Design” we are now plotting revenue as well as units sold. We are customizing the second set of series to use a different X axis in C# code&lt;/p&gt;&lt;pre class="code"&gt;&lt;span style="COLOR:#2b91af;"&gt;Axis &lt;/span&gt;axis = &lt;span style="COLOR:blue;"&gt;new &lt;/span&gt;&lt;span style="COLOR:#2b91af;"&gt;Axis&lt;/span&gt;();
axis.Position = &lt;span style="COLOR:#2b91af;"&gt;AxisPosition&lt;/span&gt;.Far;
axis.Grids.Major.Visibility = &lt;span style="COLOR:#2b91af;"&gt;Visibility&lt;/span&gt;.Collapsed;
chart1.AxesY.Add(axis);
chart1.Series[2].AxisY = axis;
chart1.Series[3].AxisY = axis;
axis.Title = &lt;span style="COLOR:blue;"&gt;new &lt;/span&gt;&lt;span style="COLOR:#2b91af;"&gt;Title&lt;/span&gt;(&lt;span style="COLOR:#a31515;"&gt;&amp;quot;Units in 00s&amp;quot;&lt;/span&gt;);
chart1.AxisY.Title = &lt;span style="COLOR:blue;"&gt;new &lt;/span&gt;&lt;span style="COLOR:#2b91af;"&gt;Title&lt;/span&gt;(&lt;span style="COLOR:#a31515;"&gt;&amp;quot;Revenue in 000s&amp;quot;&lt;/span&gt;);&lt;/pre&gt;
&lt;p&gt;&lt;a href="http://community.softwarefx.com/blogs/wpf/Bullet5_4E6EB33C.png"&gt;&lt;img style="BORDER-BOTTOM:0px;BORDER-LEFT:0px;DISPLAY:inline;BORDER-TOP:0px;BORDER-RIGHT:0px;" title="Bullet5" border="0" alt="Bullet5" src="http://community.softwarefx.com/blogs/wpf/Bullet5_thumb_42D8F5FD.png" width="244" height="171" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;In future builds we also plan to expose this new gallery through our design time wizard, which means you will be able to create fully customized bullet charts from Visual Studio or Expression Blend 3.&lt;/p&gt;
&lt;p&gt;JuanC&lt;/p&gt;&lt;img src="http://community.softwarefx.com/aggbug.aspx?PostID=25995" width="1" height="1"&gt;</content><author><name>JuanC</name><uri>http://community.softwarefx.com/members/JuanC.aspx</uri></author><category term="Gallery" scheme="http://community.softwarefx.com/blogs/wpf/archive/tags/Gallery/default.aspx" /><category term="Bullet" scheme="http://community.softwarefx.com/blogs/wpf/archive/tags/Bullet/default.aspx" /><category term="Sparkline" scheme="http://community.softwarefx.com/blogs/wpf/archive/tags/Sparkline/default.aspx" /></entry><entry><title>Minimizing Ink (Part 2)</title><link rel="alternate" type="text/html" href="http://community.softwarefx.com/blogs/wpf/archive/2009/08/19/minimizing-ink-part-2.aspx" /><id>http://community.softwarefx.com/blogs/wpf/archive/2009/08/19/minimizing-ink-part-2.aspx</id><published>2009-08-19T20:50:12Z</published><updated>2009-08-19T20:50:12Z</updated><content type="html">&lt;p&gt;This post will add features to the sparkline chart built on our previous &lt;a href="http://community.softwarefx.com/blogs/wpf/archive/2009/05/22/minimizing-ink.aspx" target="_blank"&gt;minimizing ink&lt;/a&gt; post and it is driven by comments and emails we have received about this topic.&lt;/p&gt;  &lt;p&gt;Q: One reader asks “The value being plotted will have a min and max range. I would like to draw a light gray rectangle in the back ground using these ranges and overlap the plot on top. If any of the values are out of range I can easily looking at the sparkline. do you have any idea how to do this?”&lt;/p&gt;  &lt;p&gt;A: There are two important issues in order to implement this feature, first our Y axis was not visible in order to minimize space but if we want to show this range using Axis sections we have to make sure the axis is visible without showing any labels or gridlines. The XAML required to hide the labels and gridlines looks like this&lt;/p&gt;  &lt;pre class="code"&gt;&lt;span style="color:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="color:blue;"&gt;:&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Chart.AxisY&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;
  &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="color:blue;"&gt;:&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Axis &lt;/span&gt;&lt;span style="color:red;"&gt;Separation&lt;/span&gt;&lt;span style="color:blue;"&gt;=&amp;quot;0&amp;quot;&amp;gt;
&lt;/span&gt;&lt;span style="color:green;"&gt;    &lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="color:blue;"&gt;:&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Axis.Labels&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;
      &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="color:blue;"&gt;:&lt;/span&gt;&lt;span style="color:#a31515;"&gt;AxisLabelAttributes &lt;/span&gt;&lt;span style="color:red;"&gt;Visibility&lt;/span&gt;&lt;span style="color:blue;"&gt;=&amp;quot;Collapsed&amp;quot;/&amp;gt;
    &amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="color:blue;"&gt;:&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Axis.Labels&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;
    &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="color:blue;"&gt;:&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Axis.Grids&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;
      &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="color:blue;"&gt;:&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Grids&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;
        &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="color:blue;"&gt;:&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Grids.Major&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;
          &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="color:blue;"&gt;:&lt;/span&gt;&lt;span style="color:#a31515;"&gt;GridLine &lt;/span&gt;&lt;span style="color:red;"&gt;Visibility&lt;/span&gt;&lt;span style="color:blue;"&gt;=&amp;quot;Collapsed&amp;quot; &lt;/span&gt;&lt;span style="color:red;"&gt;TickMark&lt;/span&gt;&lt;span style="color:blue;"&gt;=&amp;quot;None&amp;quot;/&amp;gt;
        &amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="color:blue;"&gt;:&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Grids.Major&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;
        &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="color:blue;"&gt;:&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Grids.Minor&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;
          &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="color:blue;"&gt;:&lt;/span&gt;&lt;span style="color:#a31515;"&gt;GridLine &lt;/span&gt;&lt;span style="color:red;"&gt;Visibility&lt;/span&gt;&lt;span style="color:blue;"&gt;=&amp;quot;Collapsed&amp;quot; &lt;/span&gt;&lt;span style="color:red;"&gt;TickMark&lt;/span&gt;&lt;span style="color:blue;"&gt;=&amp;quot;None&amp;quot;/&amp;gt;
        &amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="color:blue;"&gt;:&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Grids.Minor&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;
      &amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="color:blue;"&gt;:&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Grids&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;
    &amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="color:blue;"&gt;:&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Axis.Grids&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;
  &amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="color:blue;"&gt;:&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Axis&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;
&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="color:blue;"&gt;:&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Chart.AxisY&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;
&lt;/span&gt;&lt;/pre&gt;
&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;

&lt;p&gt;Hopefully how to hide gridlines and labels was intuitive but setting Separation to 0 is key to minimize the space we assign to the axis. Now we are ready to create an axis section, I will assume that the min and max range is calculated per product (per chart) so we will assume that our data layer class ProductInfo has 2 extra properties called MinDownloads and MaxDownloads.&lt;/p&gt;

&lt;pre class="code"&gt;    &lt;span style="color:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="color:blue;"&gt;:&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Axis.Sections&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;
      &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="color:blue;"&gt;:&lt;/span&gt;&lt;span style="color:#a31515;"&gt;AxisSection &lt;/span&gt;&lt;span style="color:red;"&gt;From&lt;/span&gt;&lt;span style="color:blue;"&gt;=&amp;quot;{&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Binding &lt;/span&gt;&lt;span style="color:red;"&gt;Path&lt;/span&gt;&lt;span style="color:blue;"&gt;=MinDownloads}&amp;quot;&lt;br /&gt;                       &lt;/span&gt;&lt;span style="color:red;"&gt;To&lt;/span&gt;&lt;span style="color:blue;"&gt;=&amp;quot;{&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Binding &lt;/span&gt;&lt;span style="color:red;"&gt;Path&lt;/span&gt;&lt;span style="color:blue;"&gt;=MaxDownloads}&amp;quot; &lt;/span&gt;&lt;span style="color:red;"&gt;Background&lt;/span&gt;&lt;span style="color:blue;"&gt;=&amp;quot;#A0A0A0&amp;quot; /&amp;gt;
    &amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="color:blue;"&gt;:&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Axis.Sections&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;

&lt;p&gt;This results in a range shown per product, note that AxisSection.From and AxisSection.To were not Dependency Properties on previous builds so you will have to make sure you are using build 3516 or later in order to get the bindings to work.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://community.softwarefx.com/blogs/wpf/MinimizeInk4_02BAF4AE.png"&gt;&lt;img style="border-bottom:0px;border-left:0px;display:inline;border-top:0px;border-right:0px;" title="MinimizeInk4" border="0" alt="MinimizeInk4" src="http://community.softwarefx.com/blogs/wpf/MinimizeInk4_thumb_2269CE76.png" width="244" height="103" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Q: An email asks the following “Is it possible to display a marker on the max value on each line?”&lt;/p&gt;

&lt;p&gt;A: In order to implement this we have added a MaximumValueCondition and MinimumValueCondition classes in build 3517 or later, this will allow you to use our conditional attributes as follows&lt;/p&gt;

&lt;pre class="code"&gt;  &lt;span style="color:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="color:blue;"&gt;:&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Chart.ConditionalAttributes&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;
    &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="color:blue;"&gt;:&lt;/span&gt;&lt;span style="color:#a31515;"&gt;ConditionalAttributes&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;
      &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="color:blue;"&gt;:&lt;/span&gt;&lt;span style="color:#a31515;"&gt;ConditionalAttributes.Condition&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;
        &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="color:blue;"&gt;:&lt;/span&gt;&lt;span style="color:#a31515;"&gt;MaximumValueCondition&lt;/span&gt;&lt;span style="color:blue;"&gt;/&amp;gt;
      &amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="color:blue;"&gt;:&lt;/span&gt;&lt;span style="color:#a31515;"&gt;ConditionalAttributes.Condition&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;
      &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="color:blue;"&gt;:&lt;/span&gt;&lt;span style="color:#a31515;"&gt;ConditionalAttributes.Marker&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;
        &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="color:blue;"&gt;:&lt;/span&gt;&lt;span style="color:#a31515;"&gt;MarkerAttributes &lt;/span&gt;&lt;span style="color:red;"&gt;Visibility&lt;/span&gt;&lt;span style="color:blue;"&gt;=&amp;quot;Visible&amp;quot; &lt;/span&gt;&lt;span style="color:red;"&gt;Fill&lt;/span&gt;&lt;span style="color:blue;"&gt;=&amp;quot;Red&amp;quot;&lt;br /&gt;                              &lt;span style="color:red;"&gt;Size&lt;/span&gt;&lt;span style="color:blue;"&gt;=&amp;quot;6&amp;quot; &lt;/span&gt;&lt;span style="color:red;"&gt;Shape&lt;/span&gt;&lt;span style="color:blue;"&gt;=&amp;quot;Circle&amp;quot; &lt;/span&gt;/&amp;gt;
      &amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="color:blue;"&gt;:&lt;/span&gt;&lt;span style="color:#a31515;"&gt;ConditionalAttributes.Marker&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;
    &amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="color:blue;"&gt;:&lt;/span&gt;&lt;span style="color:#a31515;"&gt;ConditionalAttributes&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;
&lt;/span&gt;&lt;span style="color:green;"&gt;  &lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="color:blue;"&gt;:&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Chart.ConditionalAttributes&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;

&lt;p&gt;Now you can quickly see when the number of downloads for each product peaked. Note that our MaximumValueCondition class might flag more than 1 point if 2 or more points share the max value, also note that in a multi series chart we will default to calculate the max per series but you can change this behavior setting the PerSeries property to false.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://community.softwarefx.com/blogs/wpf/MinimizeInk5_570A2AB1.png"&gt;&lt;img style="border-bottom:0px;border-left:0px;display:inline;border-top:0px;border-right:0px;" title="MinimizeInk5" border="0" alt="MinimizeInk5" src="http://community.softwarefx.com/blogs/wpf/MinimizeInk5_thumb_68E6BE7E.png" width="244" height="103" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Finally we can use the same class but bind it to the X value if we want to display a point label showing the last value on each chart.&lt;/p&gt;

&lt;pre class="code"&gt;      &lt;span style="color:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="color:blue;"&gt;:&lt;/span&gt;&lt;span style="color:#a31515;"&gt;ConditionalAttributes&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;
        &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="color:blue;"&gt;:&lt;/span&gt;&lt;span style="color:#a31515;"&gt;ConditionalAttributes.Condition&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;
          &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="color:blue;"&gt;:&lt;/span&gt;&lt;span style="color:#a31515;"&gt;MaximumValueCondition &lt;/span&gt;&lt;span style="color:red;"&gt;BindingPath&lt;/span&gt;&lt;span style="color:blue;"&gt;=&amp;quot;X&amp;quot;/&amp;gt;
        &amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="color:blue;"&gt;:&lt;/span&gt;&lt;span style="color:#a31515;"&gt;ConditionalAttributes.Condition&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;
        &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="color:blue;"&gt;:&lt;/span&gt;&lt;span style="color:#a31515;"&gt;ConditionalAttributes.PointLabels&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;
          &amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="color:blue;"&gt;:&lt;/span&gt;&lt;span style="color:#a31515;"&gt;PointLabelAttributes &lt;/span&gt;&lt;span style="color:red;"&gt;Visibility&lt;/span&gt;&lt;span style="color:blue;"&gt;=&amp;quot;Visible&amp;quot; &lt;/span&gt;&lt;span style="color:red;"&gt;Offset&lt;/span&gt;&lt;span style="color:blue;"&gt;=&amp;quot;3,0&amp;quot;&lt;br /&gt;                                    &lt;/span&gt;&lt;span style="color:red;"&gt;HorizontalAlignment&lt;/span&gt;&lt;span style="color:blue;"&gt;=&amp;quot;Right&amp;quot;&lt;br /&gt;                                    &lt;/span&gt;&lt;span style="color:red;"&gt;VerticalAlignment&lt;/span&gt;&lt;span style="color:blue;"&gt;=&amp;quot;Center&amp;quot; &lt;/span&gt;&lt;span style="color:red;"&gt;FontSize&lt;/span&gt;&lt;span style="color:blue;"&gt;=&amp;quot;7&amp;quot;/&amp;gt;
        &amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="color:blue;"&gt;:&lt;/span&gt;&lt;span style="color:#a31515;"&gt;ConditionalAttributes.PointLabels&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;
      &amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="color:blue;"&gt;:&lt;/span&gt;&lt;span style="color:#a31515;"&gt;ConditionalAttributes&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;

&lt;p&gt;Note that in this case we are showing the point labels for the point that matches this condition and we are making sure the label is properly aligned to the right of the line.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://community.softwarefx.com/blogs/wpf/MinimizeInk6_6F99C801.png"&gt;&lt;img style="border-bottom:0px;border-left:0px;display:inline;border-top:0px;border-right:0px;" title="MinimizeInk6" border="0" alt="MinimizeInk6" src="http://community.softwarefx.com/blogs/wpf/MinimizeInk6_thumb_01765BCF.png" width="244" height="103" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;JuanC&lt;/p&gt;&lt;img src="http://community.softwarefx.com/aggbug.aspx?PostID=25936" width="1" height="1"&gt;</content><author><name>JuanC</name><uri>http://community.softwarefx.com/members/JuanC.aspx</uri></author><category term="HOWTO" scheme="http://community.softwarefx.com/blogs/wpf/archive/tags/HOWTO/default.aspx" /><category term="Sparkline" scheme="http://community.softwarefx.com/blogs/wpf/archive/tags/Sparkline/default.aspx" /></entry><entry><title>Comparing multiple variables using a pane matrix (Part 2 of 2)</title><link rel="alternate" type="text/html" href="http://community.softwarefx.com/blogs/wpf/archive/2009/08/15/comparing-multiple-variables-using-a-pane-matrix-part-2-of-2.aspx" /><link rel="enclosure" type="text/plain" length="16175" href="http://community.softwarefx.com/blogs/wpf/attachment/25912.ashx" /><id>http://community.softwarefx.com/blogs/wpf/archive/2009/08/15/comparing-multiple-variables-using-a-pane-matrix-part-2-of-2.aspx</id><published>2009-08-15T19:52:00Z</published><updated>2009-08-15T19:52:00Z</updated><content type="html">&lt;p&gt;In &lt;a href="http://community.softwarefx.com/blogs/wpf/archive/2009/08/05/comparing-multiple-variables-using-a-pane-matrix-part-1-of-2.aspx" target="_blank"&gt;part 1&lt;/a&gt; we showed how to use the crosstab transform and the GridPanePanel to create a pane matrix where users can quickly compare multiple variables, in this post we will try to improve other aspects of the chart, one of the main differentiators WPF brings to the table is the use of data templates to include rich information about your data in any control. In our sample let’s assume that instead of sales per region, we are tracking sales per country, this means that our data layer could easily add a string property that returns a URI with the flag for such country. When crosstab returns the per-dimension information we keep track of the first element that belongs to each dimension, e.g.&lt;/p&gt;&lt;pre class="code"&gt;&lt;span style="COLOR:#2b91af;"&gt;DataTemplate &lt;/span&gt;regionTemplate = (&lt;span style="COLOR:#2b91af;"&gt;DataTemplate&lt;/span&gt;) FindResource(&lt;span style="COLOR:#a31515;"&gt;&amp;quot;regionTemplate&amp;quot;&lt;/span&gt;);

&lt;span style="COLOR:blue;"&gt;foreach &lt;/span&gt;(&lt;span style="COLOR:#2b91af;"&gt;CrosstabDimensionValue &lt;/span&gt;columnDimension &lt;span style="COLOR:blue;"&gt;in &lt;/span&gt;crosstab1.Dimensions[0]) {
    &lt;span style="COLOR:#2b91af;"&gt;GridPanePanelColumnDefinition &lt;/span&gt;columnDefinition =&lt;br /&gt;                            &lt;span style="COLOR:blue;"&gt;new &lt;/span&gt;&lt;span style="COLOR:#2b91af;"&gt;GridPanePanelColumnDefinition&lt;/span&gt;();
    &lt;span style="COLOR:green;"&gt;// columnDefinition.Header = columnDimension.Name;
    &lt;/span&gt;&lt;span style="COLOR:#2b91af;"&gt;ContentControl &lt;/span&gt;contentControl = &lt;span style="COLOR:blue;"&gt;new &lt;/span&gt;&lt;span style="COLOR:#2b91af;"&gt;ContentControl&lt;/span&gt;();
    contentControl.Content = columnDimension.DataItem;
    contentControl.ContentTemplate = regionTemplate;
    columnDefinition.Header = contentControl;
    gridPanePanel.ColumnDefinitions.Add(columnDefinition);
}&lt;/pre&gt;&lt;pre class="code"&gt;&lt;span style="COLOR:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;DataTemplate &lt;/span&gt;&lt;span style="COLOR:red;"&gt;x&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:red;"&gt;Key&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;regionTemplate&amp;quot;&amp;gt;
  &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;StackPanel &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Orientation&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;Horizontal&amp;quot; &lt;/span&gt;&lt;span style="COLOR:red;"&gt;HorizontalAlignment&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;Center&amp;quot;&amp;gt;
    &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Image &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Source&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;{&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Binding &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Path&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=Image}&amp;quot; &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Width&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;15&amp;quot; &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Height&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;20&amp;quot; &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Margin&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;0,0,4,0&amp;quot;/&amp;gt;
    &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;TextBlock &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Text&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;{&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Binding &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Path&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=Region}&amp;quot; &lt;/span&gt;&lt;span style="COLOR:red;"&gt;VerticalAlignment&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;Center&amp;quot;/&amp;gt;
  &amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;StackPanel&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
&amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;DataTemplate&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
&lt;/span&gt;&lt;/pre&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;
&lt;p&gt;&lt;a href="http://community.softwarefx.com/blogs/wpf/PaneMatrix6_383EFDAD.png"&gt;&lt;img style="BORDER-RIGHT-WIDTH:0px;DISPLAY:inline;BORDER-TOP-WIDTH:0px;BORDER-BOTTOM-WIDTH:0px;BORDER-LEFT-WIDTH:0px;" title="PaneMatrix6" border="0" alt="PaneMatrix6" src="http://community.softwarefx.com/blogs/wpf/PaneMatrix6_thumb_21BC3959.png" width="244" height="149" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;Note the images on top which will help when trying to locate a specific country, by hovering over a specific point I wanted to point out 2 details where the trick in which each series represents a combination of Region+Product+Year is leaking out. First note that the first line of the tooltip reads “Japan, ABC Widget, 2007” , also note that no other 2007 plot is highlighted even though we created a fake legend and made sure all lines that represent 2007 have the same color.&lt;/p&gt;
&lt;p&gt;To fix the first issue we will use the fact that crosstab will automatically assign to each series the first object that matched that series as the Series.Content so all we need to do is provide a template and use it as the Series.ContentTemplate&lt;/p&gt;&lt;pre class="code"&gt;&lt;span style="COLOR:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;DataTemplate &lt;/span&gt;&lt;span style="COLOR:red;"&gt;x&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:red;"&gt;Key&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;seriesTemplate&amp;quot;&amp;gt;
  &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Grid&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
    &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Grid.ColumnDefinitions&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
      &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;ColumnDefinition &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Width&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;Auto&amp;quot; /&amp;gt;
      &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;ColumnDefinition &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Width&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;4&amp;quot; /&amp;gt;
      &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;ColumnDefinition &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Width&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;Auto&amp;quot; /&amp;gt;
    &amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Grid.ColumnDefinitions&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
    &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Grid.RowDefinitions&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
      &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;RowDefinition &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Height&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;Auto&amp;quot; /&amp;gt;
      &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;RowDefinition &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Height&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;Auto&amp;quot; /&amp;gt;
      &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;RowDefinition &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Height&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;Auto&amp;quot; /&amp;gt;
    &amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Grid.RowDefinitions&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
    &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;TextBlock &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Text&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;Region:&amp;quot; &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Grid.Row&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;0&amp;quot; &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Grid.Column&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;0&amp;quot;/&amp;gt;
    &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;TextBlock &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Text&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;{&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Binding &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Path&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=Region}&amp;quot; &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Grid.Row&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;0&amp;quot; &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Grid.Column&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;2&amp;quot;/&amp;gt;
    &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;TextBlock &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Text&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;Product:&amp;quot; &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Grid.Row&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;1&amp;quot; &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Grid.Column&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;0&amp;quot;/&amp;gt;
    &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;TextBlock &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Text&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;{&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Binding &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Path&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=Product}&amp;quot; &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Grid.Row&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;1&amp;quot; &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Grid.Column&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;2&amp;quot;/&amp;gt;
    &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;TextBlock &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Text&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;Year:&amp;quot; &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Grid.Row&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;2&amp;quot; &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Grid.Column&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;0&amp;quot;/&amp;gt;
    &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;TextBlock &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Text&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;{&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Binding &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Path&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=Year}&amp;quot; &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Grid.Row&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;2&amp;quot; &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Grid.Column&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;2&amp;quot;/&amp;gt;
  &amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Grid&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
&amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;DataTemplate&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class="code"&gt;  &lt;span style="COLOR:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Chart.AllSeries&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
    &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;AllSeriesAttributes &lt;/span&gt;&lt;span style="COLOR:red;"&gt;ContentTemplate&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;{&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;StaticResource &lt;/span&gt;&lt;span style="COLOR:red;"&gt;seriesTemplate&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;}&amp;quot;/&amp;gt;
  &amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Chart.AllSeries&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class="code"&gt;&lt;span style="COLOR:blue;"&gt;&lt;a href="http://community.softwarefx.com/blogs/wpf/PaneMatrix7_6A46025D.png"&gt;&lt;img style="BORDER-RIGHT-WIDTH:0px;DISPLAY:inline;BORDER-TOP-WIDTH:0px;BORDER-BOTTOM-WIDTH:0px;BORDER-LEFT-WIDTH:0px;" title="PaneMatrix7" border="0" alt="PaneMatrix7" src="http://community.softwarefx.com/blogs/wpf/PaneMatrix7_thumb_309342A6.png" width="244" height="149" /&gt;&lt;/a&gt; &lt;/span&gt;&lt;/pre&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;
&lt;p&gt;I combined 2 screenshots so that you can see that our solution works well both when you hover over a point and over the line connecting 2 points, there is an alternate solution where you can set the AllSeries.ToolTips Template and ConnectedTemplate independently, this would give finer control over the information shown in both cases.&lt;/p&gt;
&lt;p&gt;To improve highlighting&amp;nbsp; we will use a new feature introduced in build 3515 or later. Internally we use an interface called IHighlightResolver to allow different implementations of what should be dimmed/highlighted, although this interface has always been public we did not have an easy entry point where you could plug your own highlighter. Now there is an event in Chart.Highlight called CreatingResolver which allows just that, to make this scenario even easier we also created a CrosstabDimensionResolver in the ChartFX.WPF.Data assembly that knows about how crosstabs joins multiple series.&lt;/p&gt;&lt;pre class="code"&gt;&lt;span style="COLOR:blue;"&gt;private void &lt;/span&gt;PageLoaded (&lt;span style="COLOR:blue;"&gt;object &lt;/span&gt;sender, &lt;span style="COLOR:#2b91af;"&gt;EventArgs &lt;/span&gt;e)
{
    chart1.DataBound += &lt;span style="COLOR:blue;"&gt;new &lt;/span&gt;&lt;span style="COLOR:#2b91af;"&gt;EventHandler&lt;/span&gt;(OnChartDataBound);
    chart1.Highlight.CreatingResolver +=&lt;br /&gt;               &lt;span style="COLOR:blue;"&gt;new &lt;/span&gt;&lt;span style="COLOR:#2b91af;"&gt;HighlightResolverEventHandler&lt;/span&gt;(OnCreatingResolver);
}

&lt;span style="COLOR:blue;"&gt;private void &lt;/span&gt;OnCreatingResolver (&lt;span style="COLOR:blue;"&gt;object &lt;/span&gt;sender, &lt;span style="COLOR:#2b91af;"&gt;HighlightingEventArgs &lt;/span&gt;args)
{
    args.Resolver = &lt;span style="COLOR:blue;"&gt;new &lt;/span&gt;&lt;span style="COLOR:#2b91af;"&gt;CrosstabDimensionResolver&lt;/span&gt;(args, crosstab1);
}&lt;br /&gt;
&lt;a href="http://community.softwarefx.com/blogs/wpf/PaneMatrix8_08146092.png"&gt;&lt;img style="BORDER-RIGHT-WIDTH:0px;DISPLAY:inline;BORDER-TOP-WIDTH:0px;BORDER-BOTTOM-WIDTH:0px;BORDER-LEFT-WIDTH:0px;" title="PaneMatrix8" border="0" alt="PaneMatrix8" src="http://community.softwarefx.com/blogs/wpf/PaneMatrix8_thumb_185FB27E.png" width="244" height="149" /&gt;&lt;/a&gt; &lt;/pre&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Now highlight works and you can see all the 2007-related series, now let’s assume that your data really contains several sales per month for each region+product, crosstab will automatically accumulate on a per-month basis (because you are creating a row per month) but these details will be hidden on the chart. To show these details (you could call this drill-down) we will take the following steps&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Crosstab.AggregateElements: When this property is true, crosstab will group all data items that form a specific series/row. &lt;/li&gt;
&lt;li&gt;Chart.Selection: We need to tell Chart FX that we want to keep track of the selected item &lt;/li&gt;
&lt;li&gt;Chart.ClickCommand: Allows us to specify what will happen when the user clicks a marker &lt;/li&gt;
&lt;li&gt;Chart.InfoWinfow: We will show this tool and it will be templated to show the details of the selected item &lt;/li&gt;
&lt;li&gt;AllSeries.Marker.Template: Provide a new template that will draw a rounded rectangle around the selected marker. &lt;/li&gt;&lt;/ul&gt;&lt;pre class="code"&gt;&lt;span style="COLOR:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Chart &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Template&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;{&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;StaticResource &lt;/span&gt;&lt;span style="COLOR:red;"&gt;chartTemplate&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;}&amp;quot;&lt;br /&gt;           &lt;/span&gt;&lt;span style="COLOR:red;"&gt;ClickCommand&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;{&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;x&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Static &lt;/span&gt;&lt;span style="COLOR:red;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:red;"&gt;Chart&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;.SelectCommand}&amp;quot;&amp;gt;
&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;  &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Chart.AllSeries&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
    &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;AllSeriesAttributes&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
      &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;AllSeriesAttributes.Marker&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
        &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;MarkerAttributes &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Template&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;{&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;StaticResource &lt;/span&gt;&lt;span style="COLOR:red;"&gt;markerMarbleSelection&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;}&amp;quot;/&amp;gt;
      &amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;AllSeriesAttributes.Marker&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
&lt;/span&gt;&lt;span style="COLOR:green;"&gt;    &lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;AllSeriesAttributes&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
  &amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Chart.AllSeries&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
  &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Chart.InfoWindow&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
    &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;InfoWindow &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Background&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;Transparent&amp;quot; &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Visibility&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;Visible&amp;quot;&lt;br /&gt;                    &lt;/span&gt;&lt;span style="COLOR:red;"&gt;ContentTemplate&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;{&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;StaticResource &lt;/span&gt;&lt;span style="COLOR:red;"&gt;infowindowTemplate&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;}&amp;quot;/&amp;gt;
  &amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Chart.InfoWindow&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
  &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Chart.Selection&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
    &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;SelectionAttributes &lt;/span&gt;&lt;span style="COLOR:red;"&gt;IsEnabled&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;true&amp;quot;/&amp;gt;
  &amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Chart.Selection&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
&amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Chart&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
&lt;/span&gt;&lt;/pre&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;
&lt;p&gt;I omitted the templates for both the marker and the infowindow to keep the length of this post under control, you can download the attachment that contains all the necessary XAML and code included as an attachment.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://community.softwarefx.com/blogs/wpf/PaneMatrix9_28F7AD6C.png"&gt;&lt;img style="BORDER-RIGHT-WIDTH:0px;DISPLAY:inline;BORDER-TOP-WIDTH:0px;BORDER-BOTTOM-WIDTH:0px;BORDER-LEFT-WIDTH:0px;" title="PaneMatrix9" border="0" alt="PaneMatrix9" src="http://community.softwarefx.com/blogs/wpf/PaneMatrix9_thumb_38D6CC63.png" width="244" height="149" /&gt;&lt;/a&gt; &lt;a href="http://community.softwarefx.com/blogs/wpf/PaneMatrix10_2953BA94.png"&gt;&lt;img style="BORDER-RIGHT-WIDTH:0px;DISPLAY:inline;BORDER-TOP-WIDTH:0px;BORDER-BOTTOM-WIDTH:0px;BORDER-LEFT-WIDTH:0px;" title="PaneMatrix10" border="0" alt="PaneMatrix10" src="http://community.softwarefx.com/blogs/wpf/PaneMatrix10_thumb_71DD8398.png" width="244" height="149" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;We hope this post will allow you to see the power that Chart FX for WPF exposes to implement BI solutions in your WPF application.&lt;/p&gt;
&lt;p&gt;JuanC&lt;/p&gt;&lt;img src="http://community.softwarefx.com/aggbug.aspx?PostID=25912" width="1" height="1"&gt;</content><author><name>JuanC</name><uri>http://community.softwarefx.com/members/JuanC.aspx</uri></author></entry><entry><title>Plotting Geographical Data as a Contour</title><link rel="alternate" type="text/html" href="http://community.softwarefx.com/blogs/wpf/archive/2009/08/06/map-chart-using-surfacexyz.aspx" /><id>http://community.softwarefx.com/blogs/wpf/archive/2009/08/06/map-chart-using-surfacexyz.aspx</id><published>2009-08-06T22:02:55Z</published><updated>2009-08-06T22:02:55Z</updated><content type="html">&lt;p&gt;Note: This post makes use of the XYZExtension, which at the time the post was written was not available on the public version of Chart FX for WPF. If you are interested in using the extension before its release with the next Service Pack you may download the hotfix at &lt;a title="http://support.softwarefx.com/cfxwpf/update/hotfix/hotfix.htm" href="http://support.softwarefx.com/cfxwpf/update/hotfix/hotfix.htm"&gt;http://support.softwarefx.com/cfxwpf/update/hotfix/hotfix.htm&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;Chart FX for WPF is about to introduce a brand new feature: the XYZExtension. This extension will allow us to add and control a third axis (Z axis) on a 3D chart. For the first time it will be possible to plot X, Y and Z values to a Chart FX chart. Right out of the gate there are two different galleries that can use this extension: SurfaceXYZ and ScatterXYZ. Multiple series of each or even combinations are also possible.&lt;/p&gt;  &lt;p&gt;One of the cool things I was able to accomplish with the new SurfaceXYZ chart was create geographically accurate surface with data from different cities. I can see multiple uses for a chart like this, from temperature plotting, revenue per county or even sales per store in one state. &lt;/p&gt;  &lt;p&gt;Suppose for the sake of this example that we need to plot the customer satisfaction rating on a little more than 800 stores across Florida. Plotting it on a bar chart will create more than 800 bars. And even if we order the cities alphabetically, while locating the score of a specific store should be easy, it is not so simple to understand which areas of the state are doing better than the others. Plotting it on a surface, on the other hand, will group all the stores by proximity allowing us to locate the best and worse regions. Particularly if we can do so over a map of the state. Here is what our final surface chart should look like.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://community.softwarefx.com/blogs/wpf/Untitled5_27443AAF.png"&gt;&lt;img title="Untitled5" style="border-top-width:0px;display:inline;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="180" alt="Untitled5" src="http://community.softwarefx.com/blogs/wpf/Untitled5_thumb_59C79821.png" width="240" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Looking at that map it is very easy to spot that the cities stores around Jacksonville and the west coast are doing better than the ones on the east coast of Florida. Let’s look at what was necessary to obtain that great chart, shall we?&lt;/p&gt;  &lt;p&gt;First thing we need is a map. I have selected a Mercator projection of the state, with no county lines. If you have not noticed yet, we are laying the map on top of our surface. That is done because the triangulation used for our surface will interpolate all the data passed to our chart, creating a false impression that data was collected from stores located in the Gulf of Mexico. To take care of that, we lay a map over the surface where the state itself is transparent. That way the non-transparent ocean will cover the interpolated data that does not make sense. Here is what our map looks like without our surface.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://community.softwarefx.com/blogs/wpf/image5_1FD85535.png"&gt;&lt;img title="image5" style="border-top-width:0px;display:inline;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="226" alt="image5" src="http://community.softwarefx.com/blogs/wpf/image5_thumb_30DC8318.png" width="240" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;Now that we have selected a map, let’s look at a slice of our data.&lt;/p&gt;  &lt;pre class="code"&gt;&lt;span style="color:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Store &lt;/span&gt;&lt;span style="color:red;"&gt;CITY&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;MIAMI&lt;/span&gt;&amp;quot; &lt;span style="color:red;"&gt;LATITUDE&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;25.64&lt;/span&gt;&amp;quot; &lt;span style="color:red;"&gt;LONGITUDE&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;-80.32&lt;/span&gt;&amp;quot; &lt;span style="color:red;"&gt;SCORE&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;91&lt;/span&gt;&amp;quot; &lt;span style="color:blue;"&gt;/&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Store &lt;/span&gt;&lt;span style="color:red;"&gt;CITY&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;NORTH MIAMI BEAC&lt;/span&gt;&amp;quot; &lt;span style="color:red;"&gt;LATITUDE&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;25.94&lt;/span&gt;&amp;quot; &lt;span style="color:red;"&gt;LONGITUDE&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;-80.14&lt;/span&gt;&amp;quot; &lt;span style="color:red;"&gt;SCORE&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;89&lt;/span&gt;&amp;quot; &lt;span style="color:blue;"&gt;/&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Store &lt;/span&gt;&lt;span style="color:red;"&gt;CITY&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;NORTH MIAMI&lt;/span&gt;&amp;quot; &lt;span style="color:red;"&gt;LATITUDE&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;25.89&lt;/span&gt;&amp;quot; &lt;span style="color:red;"&gt;LONGITUDE&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;-80.18&lt;/span&gt;&amp;quot; &lt;span style="color:red;"&gt;SCORE&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;91&lt;/span&gt;&amp;quot; &lt;span style="color:blue;"&gt;/&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Store &lt;/span&gt;&lt;span style="color:red;"&gt;CITY&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;NORTH MIAMI BEAC&lt;/span&gt;&amp;quot; &lt;span style="color:red;"&gt;LATITUDE&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;25.93&lt;/span&gt;&amp;quot; &lt;span style="color:red;"&gt;LONGITUDE&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;-80.18&lt;/span&gt;&amp;quot; &lt;span style="color:red;"&gt;SCORE&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;91&lt;/span&gt;&amp;quot; &lt;span style="color:blue;"&gt;/&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Store &lt;/span&gt;&lt;span style="color:red;"&gt;CITY&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;OLYMPIA HEIGHTS&lt;/span&gt;&amp;quot; &lt;span style="color:red;"&gt;LATITUDE&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;25.74&lt;/span&gt;&amp;quot; &lt;span style="color:red;"&gt;LONGITUDE&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;-80.36&lt;/span&gt;&amp;quot; &lt;span style="color:red;"&gt;SCORE&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;92&lt;/span&gt;&amp;quot; &lt;span style="color:blue;"&gt;/&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515;"&gt;Store &lt;/span&gt;&lt;span style="color:red;"&gt;CITY&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;MIAMI SPRINGS&lt;/span&gt;&amp;quot; &lt;span style="color:red;"&gt;LATITUDE&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;25.82&lt;/span&gt;&amp;quot; &lt;span style="color:red;"&gt;LONGITUDE&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;-80.30&lt;/span&gt;&amp;quot; &lt;span style="color:red;"&gt;SCORE&lt;/span&gt;&lt;span style="color:blue;"&gt;=&lt;/span&gt;&amp;quot;&lt;span style="color:blue;"&gt;92&lt;/span&gt;&amp;quot; &lt;span style="color:blue;"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;

&lt;p&gt;We have the latitude and longitude data for the store. While that makes it perfect to locate it via GPS, it does not make for a surface friendly data. So we are going to have to convert it to pixel values on our selected map. Since this is a Mercator projection, we use the formulas bellow to convert the data (where φ is the latitude and λ is the longitude).&lt;/p&gt;

&lt;p&gt;&lt;img title="image6" style="border-top-width:0px;display:inline;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="57" alt="image6" src="http://community.softwarefx.com/blogs/wpf/image6_3DD66329.png" width="206" border="0" /&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;To keep this a short post (or try to) I won’t post the full code for the conversion. But I will make it available as a sample on the next Service Pack (or you can ask support for it, at support [at] softwarefx [dot] com).&lt;/p&gt;

&lt;p&gt;Once we have our data formatted in a way we can use, let’s pass it to the chart and see what we get.&lt;/p&gt;

&lt;pre class="code"&gt;&lt;span style="color:#2b91af;"&gt;SurfaceXYZ &lt;/span&gt;surfaceXYZ = &lt;span style="color:blue;"&gt;new &lt;/span&gt;&lt;span style="color:#2b91af;"&gt;SurfaceXYZ&lt;/span&gt;();
surfaceXYZ.ShowPointsGridlines = &lt;span style="color:blue;"&gt;false&lt;/span&gt;;
surfaceXYZ.ShowSeriesGridlines = &lt;span style="color:blue;"&gt;false&lt;/span&gt;;
surfaceXYZ.ShowContourLines = &lt;span style="color:blue;"&gt;true&lt;/span&gt;;
chart1.ItemsSource = chartData;

&lt;span style="color:#2b91af;"&gt;SeriesAttributes &lt;/span&gt;series0 = &lt;span style="color:blue;"&gt;new &lt;/span&gt;&lt;span style="color:#2b91af;"&gt;SeriesAttributes&lt;/span&gt;();
&lt;span style="color:#2b91af;"&gt;SeriesAttributes &lt;/span&gt;series1 = &lt;span style="color:blue;"&gt;new &lt;/span&gt;&lt;span style="color:#2b91af;"&gt;SeriesAttributes&lt;/span&gt;();

series0.GalleryAttributes = surfaceXYZ;
series1.GalleryAttributes = surfaceXYZ;

series0.BindingPath = &lt;span style="color:#a31515;"&gt;&amp;quot;Score&amp;quot;&lt;/span&gt;;
series0.BindingPathX = &lt;span style="color:#a31515;"&gt;&amp;quot;X&amp;quot;&lt;/span&gt;;
series1.BindingPath = &lt;span style="color:#a31515;"&gt;&amp;quot;Y&amp;quot;&lt;/span&gt;;

chart1.Series.Add(series0);
chart1.Series.Add(series1);&lt;/pre&gt;
&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;

&lt;p&gt;Note how we need two series for an XYZ chart. The second series is bound to the Z data, but since we are looking to our surface from above in a two dimensional way, we will call it “Y” (or latitude, on a map). The Y axis represents the value we are plotting, the Score. If this was not a 2D representation of the chart (or contour) it would represent the depth or height. This is what we end up with.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://community.softwarefx.com/blogs/wpf/Untitled2_5D853CF1.png"&gt;&lt;img title="Untitled2" style="border-top-width:0px;display:inline;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="180" alt="Untitled2" src="http://community.softwarefx.com/blogs/wpf/Untitled2_thumb_7B1717F0.png" width="240" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;I am sparing you from the cosmetic code, that can also be available if requested. If we make a few changes to our chart to make it a contour, this is what we will have.&lt;/p&gt;

&lt;pre class="code"&gt;ChartFX.WPF.&lt;span style="color:#2b91af;"&gt;View3D &lt;/span&gt;view3D = chart1.View3D;
view3D.IsEnabled = &lt;span style="color:blue;"&gt;true&lt;/span&gt;;
view3D.AngleX = -90;
view3D.AngleY = 0;
view3D.Projection = &lt;span style="color:#2b91af;"&gt;Projection&lt;/span&gt;.Orthographic;
view3D.BackWallVisibility = &lt;span style="color:#2b91af;"&gt;Visibility&lt;/span&gt;.Collapsed;
chart1.AxisX.Line.Visibility = &lt;span style="color:#2b91af;"&gt;Visibility&lt;/span&gt;.Hidden;
chart1.AxisX.Grids.Major.Visibility = &lt;span style="color:#2b91af;"&gt;Visibility&lt;/span&gt;.Hidden;
view3D.Lights.Clear();
System.Windows.Media.Media3D.&lt;span style="color:#2b91af;"&gt;AmbientLight &lt;/span&gt;ambLight = 
    &lt;span style="color:blue;"&gt;new &lt;/span&gt;System.Windows.Media.Media3D.&lt;span style="color:#2b91af;"&gt;AmbientLight&lt;/span&gt;(&lt;span style="color:#2b91af;"&gt;Color&lt;/span&gt;.FromRgb(0xD0, 0xD0, 0xD0));
view3D.Lights.Add(ambLight);&lt;/pre&gt;
&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;&lt;a href="http://community.softwarefx.com/blogs/wpf/Untitled3_507B3713.png"&gt;&lt;img title="Untitled3" style="border-top-width:0px;display:inline;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="180" alt="Untitled3" src="http://community.softwarefx.com/blogs/wpf/Untitled3_thumb_7CB7BDF7.png" width="240" border="0" /&gt;&lt;/a&gt; &lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;

&lt;p&gt;If you have very sharp sight you will notice something. The “Florida shape” looks a little distorted. That happens because our contour was placed on a square, not keeping the ratio set by our chosen map. Also, the Max value of both the X and Z axis are not the values we used in our map. All that will distort our surface, making an unrealistic representation of our data. To fix that, here is the code necessary.&lt;/p&gt;

&lt;pre class="code"&gt;chart1.AxisX.Max = 820; &lt;span style="color:green;"&gt;//Height of the bitmap
&lt;/span&gt;chart1.AxisX.Min = 0;

&lt;span style="color:#2b91af;"&gt;XYZExtension &lt;/span&gt;xyzExtension = &lt;span style="color:blue;"&gt;new &lt;/span&gt;&lt;span style="color:#2b91af;"&gt;XYZExtension&lt;/span&gt;();
xyzExtension.AxisZ.Max = 772; &lt;span style="color:green;"&gt;//Width of the bitmap
&lt;/span&gt;xyzExtension.AxisZ.Min = 0;
chart1.Extensions.Add(xyzExtension);

chart1.View3D.Depth = 94.1463; &lt;span style="color:green;"&gt;//Width divided by Height&lt;/span&gt;&lt;/pre&gt;
&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;

&lt;p&gt;Note that we use the XYZExtension to control the Max and Min of our Z axis. We then set both X and Z axis’ Max and Mix to the size of the map. We also changed the Depth property to the ratio of our map (almost a square, but not really). Changing the Depth property will control the size of the Z axis.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://community.softwarefx.com/blogs/wpf/Untitled4_26B7BC20.png"&gt;&lt;img title="Untitled4" style="border-top-width:0px;display:inline;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="180" alt="Untitled4" src="http://community.softwarefx.com/blogs/wpf/Untitled4_thumb_1D7B80DF.png" width="240" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;All we need now is to put the map on top! And here is the trick. We will create an ImageBrush out of the map, use it to paint the bottom of the chart (the X Axis) and relocate the bottom of the chart to the top.&lt;/p&gt;

&lt;pre class="code"&gt;chart1.AxisX.Position = &lt;span style="color:#2b91af;"&gt;AxisPosition&lt;/span&gt;.Far;

&lt;span style="color:#2b91af;"&gt;ImageBrush &lt;/span&gt;mapBrush = &lt;span style="color:blue;"&gt;new &lt;/span&gt;&lt;span style="color:#2b91af;"&gt;ImageBrush&lt;/span&gt;();
mapBrush.Stretch = &lt;span style="color:#2b91af;"&gt;Stretch&lt;/span&gt;.Fill;
mapBrush.ImageSource = &lt;br /&gt;    &lt;span style="color:blue;"&gt;new &lt;/span&gt;&lt;span style="color:#2b91af;"&gt;BitmapImage&lt;/span&gt;(&lt;span style="color:blue;"&gt;new &lt;/span&gt;&lt;span style="color:#2b91af;"&gt;Uri&lt;/span&gt;(&lt;span style="color:#a31515;"&gt;&amp;quot;pack://siteoforigin:,,,/Resources/FloridaMap.png&amp;quot;&lt;/span&gt;));
chart1.AxisX.Background = mapBrush;
chart1.View3D.Wall.Thickness = 1;&lt;/pre&gt;

&lt;p&gt;&lt;a href="http://community.softwarefx.com/blogs/wpf/Untitled5_37ABC436.png"&gt;&lt;img title="Untitled5" style="border-top-width:0px;display:inline;border-left-width:0px;border-bottom-width:0px;border-right-width:0px;" height="180" alt="Untitled5" src="http://community.softwarefx.com/blogs/wpf/Untitled5_thumb_71BA9115.png" width="240" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Voilà! Our chart is ready. As mentioned before (more than a couple times, i guess), the necessary API to create a chart like this will be available on our next Service Pack, but if you can’t wait to play with it, download the hotfix at &lt;a title="http://support.softwarefx.com/cfxwpf/update/hotfix/hotfix.htm" href="http://support.softwarefx.com/cfxwpf/update/hotfix/hotfix.htm"&gt;http://support.softwarefx.com/cfxwpf/update/hotfix/hotfix.htm&lt;/a&gt;.&lt;/p&gt;&lt;img src="http://community.softwarefx.com/aggbug.aspx?PostID=25845" width="1" height="1"&gt;</content><author><name>AndreG</name><uri>http://community.softwarefx.com/members/AndreG.aspx</uri></author><category term="Gallery" scheme="http://community.softwarefx.com/blogs/wpf/archive/tags/Gallery/default.aspx" /></entry><entry><title>Comparing multiple variables using a pane matrix (Part 1 of 2)</title><link rel="alternate" type="text/html" href="http://community.softwarefx.com/blogs/wpf/archive/2009/08/05/comparing-multiple-variables-using-a-pane-matrix-part-1-of-2.aspx" /><link rel="enclosure" type="text/plain" length="6883" href="http://community.softwarefx.com/blogs/wpf/attachment/25816.ashx" /><id>http://community.softwarefx.com/blogs/wpf/archive/2009/08/05/comparing-multiple-variables-using-a-pane-matrix-part-1-of-2.aspx</id><published>2009-08-05T19:17:00Z</published><updated>2009-08-05T19:17:00Z</updated><content type="html">&lt;p&gt;There are many cases when the data to be plotted must be analyzed considering multiple variables, for example you might want to track sales of multiple products in multiple regions and encompassing multiple years. Let’s assume our data layer looks like this&lt;/p&gt;&lt;pre class="code"&gt;&lt;span style="COLOR:blue;"&gt;public class &lt;/span&gt;&lt;span style="COLOR:#2b91af;"&gt;ProductSalesInfo
&lt;/span&gt;{
    &lt;span style="COLOR:blue;"&gt;public double &lt;/span&gt;Sales { &lt;span style="COLOR:blue;"&gt;get&lt;/span&gt;; &lt;span style="COLOR:blue;"&gt;set&lt;/span&gt;; }
    &lt;span style="COLOR:blue;"&gt;public string &lt;/span&gt;Region { &lt;span style="COLOR:blue;"&gt;get&lt;/span&gt;; &lt;span style="COLOR:blue;"&gt;set&lt;/span&gt;; }
    &lt;span style="COLOR:blue;"&gt;public &lt;/span&gt;&lt;span style="COLOR:#2b91af;"&gt;DateTime &lt;/span&gt;Date { &lt;span style="COLOR:blue;"&gt;get&lt;/span&gt;; &lt;span style="COLOR:blue;"&gt;set&lt;/span&gt;; }
    &lt;span style="COLOR:blue;"&gt;public string &lt;/span&gt;Product { &lt;span style="COLOR:blue;"&gt;get&lt;/span&gt;; &lt;span style="COLOR:blue;"&gt;set&lt;/span&gt;; }

    &lt;span style="COLOR:blue;"&gt;public int &lt;/span&gt;Year
    {
        &lt;span style="COLOR:blue;"&gt;get &lt;/span&gt;{ &lt;span style="COLOR:blue;"&gt;return &lt;/span&gt;Date.Year; }
    }

    &lt;span style="COLOR:blue;"&gt;public int &lt;/span&gt;Month
    {
        &lt;span style="COLOR:blue;"&gt;get &lt;/span&gt;{ &lt;span style="COLOR:blue;"&gt;return &lt;/span&gt;Date.Month; }
    }

    &lt;span style="COLOR:blue;"&gt;public string &lt;/span&gt;MonthName
    {
        &lt;span style="COLOR:blue;"&gt;get &lt;/span&gt;{ &lt;span style="COLOR:blue;"&gt;return &lt;/span&gt;Date.ToString(&lt;span style="COLOR:#a31515;"&gt;&amp;quot;MMM&amp;quot;&lt;/span&gt;); }
    }
}&lt;/pre&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;
&lt;p&gt;We have added some helper properties (Year, Month and MonthName) as these will help us setting up our bindings. Our first approach to the problem includes using the crosstab data transform to make sure Chart FX plots one series per each unique combination of variables.&lt;/p&gt;&lt;pre class="code"&gt;&lt;span style="COLOR:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Chart &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Gallery&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;Line&amp;quot; &lt;/span&gt;&lt;span style="COLOR:red;"&gt;x&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:red;"&gt;Name&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;chart1&amp;quot; &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Style&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;{&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;x&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Static &lt;/span&gt;&lt;span style="COLOR:red;"&gt;cfxMotifs&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:red;"&gt;Basic&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;.Style}&amp;quot;&amp;gt;
  &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Chart.DataTransforms&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
    &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfxData&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;CrosstabTransform &lt;/span&gt;&lt;span style="COLOR:red;"&gt;x&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:red;"&gt;Name&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;crosstab1&amp;quot; &lt;br /&gt;                               &lt;/span&gt;&lt;span style="COLOR:red;"&gt;RowPath&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;Month&amp;quot; &lt;/span&gt;&lt;span style="COLOR:red;"&gt;ColumnPath&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;Region,Product,Year&amp;quot;&lt;br /&gt;                               &lt;/span&gt;&lt;span style="COLOR:red;"&gt;ValuePath&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;Sales&amp;quot; /&amp;gt;
  &amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Chart.DataTransforms&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
&amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Chart&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
&lt;/span&gt;&lt;/pre&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;
&lt;p&gt;&lt;a href="http://community.softwarefx.com/blogs/wpf/PaneMatrix1_3FB87BAD.png"&gt;&lt;img style="BORDER-BOTTOM:0px;BORDER-LEFT:0px;DISPLAY:inline;BORDER-TOP:0px;BORDER-RIGHT:0px;" title="PaneMatrix1" border="0" alt="PaneMatrix1" src="http://community.softwarefx.com/blogs/wpf/PaneMatrix1_thumb_4CB25BBE.png" width="244" height="149" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;As promised, we got a series per variable combination but it would be very difficult to detect trends in this picture, what we need is to layout multiple panes in such a way that each column in our grid represents a region and each row represents a product. Although we include a GridPanePanel as a way to layout multiple panes inside the chart, it has no knowledge about the nature of the data so it will just calculate a “round” number of rows and columns to accommodate the total number of panes. Also note that we do not sell ABC Widgets in Asia but if we want to create a matrix we will need to make sure we account for this.&lt;/p&gt;
&lt;p&gt;To help in this common scenario we have added some properties to CrosstabTransform, the most important one is a Boolean property called JoinOnColumns, when set to true, Crosstab will make sure that the series combinations are such that they can be easily plotted in a matrix, so it will add fake series where needed and also make sure that the ordering of the series is always the same. Crosstab also exposes a Dimensions property that allows you to query for each dimension found in the data, i.e. you can get a list of all the regions, products and years in your dataset.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://community.softwarefx.com/blogs/wpf/PaneMatrix2_334A5884.png"&gt;&lt;img style="BORDER-BOTTOM:0px;BORDER-LEFT:0px;DISPLAY:inline;BORDER-TOP:0px;BORDER-RIGHT:0px;" title="PaneMatrix2" border="0" alt="PaneMatrix2" src="http://community.softwarefx.com/blogs/wpf/PaneMatrix2_thumb_79C7488C.png" width="244" height="149" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;This chart will give you a better way to spot trends for a particular product or region. The labels for the columns and rows were achieved querying the Crosstab Dimensions on the DataBound chart event and using the GridPanePanel ColumnDefinitions and RowDefinitions collections. We have also removed the gridlines to reduce clutter. We have also hidden the series from the legend box and created a couple of custom legend items that show our third series dimension (year).&lt;/p&gt;
&lt;p&gt;In this sample there is a potential problem, crosstab goes through the data and each time it finds a new Row (in this case a new Month) it adds it to a list but it will not order this list by default, this means that if the first element in your data is a sale in March this will become the first “row” so the X axis will show the months out of order, although you could maybe workaround this by making sure your data is ordered by month we have added a SortRows property that will take care of this for you, this also means we have made a Sorted property obsolete and replaced it with a hopefully more descriptive name SortColumns.&lt;/p&gt;
&lt;p&gt;Additionally we have added a RowIDPath property which allows you to sort your rows using the Month index but show the Month Name in your axis.&lt;/p&gt;&lt;pre class="code"&gt;&lt;span style="COLOR:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Chart.DataTransforms&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
  &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfxData&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;CrosstabTransform &lt;/span&gt;&lt;span style="COLOR:red;"&gt;x&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:red;"&gt;Name&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;crosstab1&amp;quot;&lt;br /&gt;          &lt;/span&gt;&lt;span style="COLOR:red;"&gt;RowIDPath&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;Month&amp;quot; &lt;/span&gt;&lt;span style="COLOR:red;"&gt;RowPath&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;MonthName&amp;quot; &lt;span style="COLOR:blue;"&gt;&lt;/span&gt;&lt;span style="COLOR:red;"&gt;SortRows&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;True&amp;quot;&lt;/span&gt;&lt;br /&gt;          &lt;/span&gt;&lt;span style="COLOR:red;"&gt;ColumnPath&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;Region,Product,Year&amp;quot;&lt;/span&gt;&lt;span style="COLOR:blue;"&gt; &lt;/span&gt;&lt;span style="COLOR:red;"&gt;JoinOnColumns&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;True&amp;quot;&lt;br /&gt;          &lt;span style="COLOR:red;"&gt;ValuePath&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;Sales&amp;quot;&lt;/span&gt;&lt;/span&gt;&lt;span style="COLOR:blue;"&gt; /&amp;gt;
&amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Chart.DataTransforms&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class="code"&gt;&lt;span style="COLOR:blue;"&gt;&lt;a href="http://community.softwarefx.com/blogs/wpf/PaneMatrix3_249FAC9F.png"&gt;&lt;img style="BORDER-BOTTOM:0px;BORDER-LEFT:0px;DISPLAY:inline;BORDER-TOP:0px;BORDER-RIGHT:0px;" title="PaneMatrix3" border="0" alt="PaneMatrix3" src="http://community.softwarefx.com/blogs/wpf/PaneMatrix3_thumb_1909EF60.png" width="244" height="149" /&gt;&lt;/a&gt; &lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;At this point we have taken care of the X axis which now shows friendlier month abbreviations and will be ordered by month index regardless of the order in the data but we have manipulated our random data to show another issue, sales of “ABC Widget” are in the thousands while “Contoso Tool” sales are in the hundreds and because we are using a single Y axis it is very hard to note any trends in the lower row.&lt;/p&gt;
&lt;p&gt;This issue can be solved in two ways, first you could use a different Y axis per row, this will still allow you to focus on a product and compare different regions using the same axis while making sure that each products gets its own Y axis.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://community.softwarefx.com/blogs/wpf/PaneMatrix4_71CFA62A.png"&gt;&lt;img style="BORDER-BOTTOM:0px;BORDER-LEFT:0px;DISPLAY:inline;BORDER-TOP:0px;BORDER-RIGHT:0px;" title="PaneMatrix4" border="0" alt="PaneMatrix4" src="http://community.softwarefx.com/blogs/wpf/PaneMatrix4_thumb_78167CB8.png" width="244" height="149" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;Alternatively, you could decide that you want to have a different axis per pane, this will make same-row comparisons more difficult but might be helpful if a product sales varies widely by region. Instead of totally hiding the Y axis we will show only the min and max labels inside the plot area.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;a href="http://community.softwarefx.com/blogs/wpf/PaneMatrix5_22EEE0CB.png"&gt;&lt;img style="BORDER-BOTTOM:0px;BORDER-LEFT:0px;DISPLAY:inline;BORDER-TOP:0px;BORDER-RIGHT:0px;" title="PaneMatrix5" border="0" alt="PaneMatrix5" src="http://community.softwarefx.com/blogs/wpf/PaneMatrix5_thumb_696BD0D3.png" width="244" height="149" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;We hope this post along with the changes we have made to the crosstab transform will help you create charts where users can analyze the data more effectively, note that you need Chart FX build 3504 or later. The code used to configure these charts was not included in the text of the post to keep it to a manageable size but it is provided as an attachment.&lt;/p&gt;
&lt;p&gt;JuanC&lt;/p&gt;&lt;img src="http://community.softwarefx.com/aggbug.aspx?PostID=25816" width="1" height="1"&gt;</content><author><name>JuanC</name><uri>http://community.softwarefx.com/members/JuanC.aspx</uri></author><category term="HOWTO" scheme="http://community.softwarefx.com/blogs/wpf/archive/tags/HOWTO/default.aspx" /></entry><entry><title>Creating a chart where each bar shows a region of a bitmap</title><link rel="alternate" type="text/html" href="http://community.softwarefx.com/blogs/wpf/archive/2009/07/20/creating-a-chart-where-each-bar-shows-a-region-of-a-bitmap.aspx" /><id>http://community.softwarefx.com/blogs/wpf/archive/2009/07/20/creating-a-chart-where-each-bar-shows-a-region-of-a-bitmap.aspx</id><published>2009-07-21T00:54:00Z</published><updated>2009-07-21T00:54:00Z</updated><content type="html">&lt;p&gt;This one is a little hard to describe but I am sure you have seen it before in magazines or newspapers. Although our API allows you to set brushes in code we will try to do all it XAML as it will allow more tweaking later. Here is our first attempt at showing an image on each bar&lt;/p&gt;&lt;pre class="code"&gt;&lt;span style="COLOR:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Chart &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Gallery&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;Bar&amp;quot;&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
  &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Chart.Series&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
    &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;SeriesAttributes&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;/&amp;gt;
  &amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Chart.Series&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
  &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Chart.AllSeries&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
    &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;AllSeriesAttributes&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
      &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;AllSeriesAttributes.Template&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
        &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;DataTemplate&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
          &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Canvas&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
            &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Rectangle &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Width&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;{&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Binding &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Path&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=Width}&amp;quot; &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Height&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;{&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Binding &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Path&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=Height}&amp;quot;&amp;gt;
              &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Rectangle.Fill&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
                &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;ImageBrush &lt;/span&gt;&lt;span style="COLOR:red;"&gt;ImageSource&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;C:\Temp\WorldMap.png&amp;quot;/&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
              &amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Rectangle.Fill&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
            &amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Rectangle&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
          &amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Canvas&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
        &amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;DataTemplate&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
      &amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;AllSeriesAttributes.Template&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
    &amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;AllSeriesAttributes&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
  &amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Chart.AllSeries&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
&amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Chart&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
&lt;/span&gt;&lt;/pre&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;
&lt;p&gt;Nothing earth shattering, we are binding width and height of the rectangle to the Width and Height of the logical items we will create, note that we do not need to worry about Left and Top, this is handled internally. We are creating a Canvas because we plan to add more visual elements later. And this is what we get.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://community.softwarefx.com/blogs/wpf/BarBitmap1_71F1632F.png"&gt;&lt;img style="BORDER-BOTTOM:0px;BORDER-LEFT:0px;DISPLAY:inline;BORDER-TOP:0px;BORDER-RIGHT:0px;" title="BarBitmap1" border="0" alt="BarBitmap1" src="http://community.softwarefx.com/blogs/wpf/BarBitmap1_thumb_79D8DFC4.png" width="240" height="149" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;Obviously this is not what we are looking for, actually there is no feature that I am aware of in WPF that allows you to draw a rectangle and specify the “region” of the ImageBrush/DrawingBrush that you would like to use for the visual. Even if we try to set Stretch to UniformToFill we will have all bars showing the same part of the world.&lt;/p&gt;
&lt;p&gt;So the idea is to make sure all bars actually draw the bitmap in the full plot area but clipped to the geometry of the bar. Our logical items support a PlotWidth and PlotHeight that return the full dimensions of the plot area but because our canvas is automatically moved to the bar position we will have to undo this movement. Our logical items expose Left and Top but not as negative so we will have to build a simple converter&lt;/p&gt;&lt;pre class="code"&gt;&lt;span style="COLOR:blue;"&gt;public class &lt;/span&gt;&lt;span style="COLOR:#2b91af;"&gt;NegateConverter &lt;/span&gt;: &lt;span style="COLOR:#2b91af;"&gt;IValueConverter
&lt;/span&gt;{
    &lt;span style="COLOR:blue;"&gt;object &lt;/span&gt;&lt;span style="COLOR:#2b91af;"&gt;IValueConverter&lt;/span&gt;.Convert (&lt;span style="COLOR:blue;"&gt;object &lt;/span&gt;value, &lt;span style="COLOR:#2b91af;"&gt;Type &lt;/span&gt;targetType,&lt;br /&gt;                                    &lt;span style="COLOR:blue;"&gt;object &lt;/span&gt;parameter, &lt;span style="COLOR:#2b91af;"&gt;CultureInfo &lt;/span&gt;culture)
    {
        &lt;span style="COLOR:blue;"&gt;if &lt;/span&gt;(value &lt;span style="COLOR:blue;"&gt;is double&lt;/span&gt;)
            &lt;span style="COLOR:blue;"&gt;return &lt;/span&gt;-((&lt;span style="COLOR:blue;"&gt;double&lt;/span&gt;) value);
        &lt;span style="COLOR:blue;"&gt;else
            return &lt;/span&gt;value;
    }

    &lt;span style="COLOR:blue;"&gt;object &lt;/span&gt;&lt;span style="COLOR:#2b91af;"&gt;IValueConverter&lt;/span&gt;.ConvertBack (&lt;span style="COLOR:blue;"&gt;object &lt;/span&gt;value, &lt;span style="COLOR:#2b91af;"&gt;Type &lt;/span&gt;targetType,&lt;br /&gt;                                        &lt;span style="COLOR:blue;"&gt;object &lt;/span&gt;parameter, &lt;span style="COLOR:#2b91af;"&gt;CultureInfo &lt;/span&gt;culture)
    {
        &lt;span style="COLOR:blue;"&gt;if &lt;/span&gt;(value &lt;span style="COLOR:blue;"&gt;is double&lt;/span&gt;)
            &lt;span style="COLOR:blue;"&gt;return &lt;/span&gt;-((&lt;span style="COLOR:blue;"&gt;double&lt;/span&gt;) value);
        &lt;span style="COLOR:blue;"&gt;else
            return &lt;/span&gt;value;
    }
}&lt;/pre&gt;
&lt;p&gt;And modify our template as follows&lt;/p&gt;&lt;pre class="code"&gt;&lt;span style="COLOR:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;DataTemplate&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
  &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Canvas&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
    &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Canvas.Resources&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
      &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;local&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;NegateConverter &lt;/span&gt;&lt;span style="COLOR:red;"&gt;x&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:red;"&gt;Key&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;negateConverter&amp;quot;/&amp;gt;
    &amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Canvas.Resources&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
    &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Rectangle &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Canvas.Left&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;{&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Binding &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Path&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=Left,&lt;br /&gt;                                          &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Converter&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;={&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;StaticResource &lt;/span&gt;&lt;span style="COLOR:red;"&gt;negateConverter&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;}}&amp;quot;&lt;br /&gt;               &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Canvas.Top&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;{&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Binding &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Path&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=Top,&lt;br /&gt;                                    &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Converter&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;={&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;StaticResource &lt;/span&gt;&lt;span style="COLOR:red;"&gt;negateConverter&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;}}&amp;quot;&lt;br /&gt;               &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Width&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;{&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Binding &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Path&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=PlotWidth}&amp;quot; &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Height&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;{&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Binding &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Path&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=PlotHeight}&amp;quot;&lt;br /&gt;               &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Clip&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;{&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Binding &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Path&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=BoundsGeometry}&amp;quot;&amp;gt;
      &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Rectangle.Fill&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
        &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;ImageBrush &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Stretch&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;UniformToFill&amp;quot; &lt;/span&gt;&lt;span style="COLOR:red;"&gt;ImageSource&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;C:\Temp\WorldMap.png&amp;quot;/&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
      &amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Rectangle.Fill&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
    &amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Rectangle&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
  &amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Canvas&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
&amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;DataTemplate&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
&lt;/span&gt;&lt;/pre&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;
&lt;p&gt;We are also setting the Clip property of the Rectangle to a brand new property in our logical item that will return a Geometry, to use this you need to be using ChartFX build 3488 or later, this gets us very close to our final look.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://community.softwarefx.com/blogs/wpf/BarBitmap2_1E1DC447.png"&gt;&lt;img style="BORDER-BOTTOM:0px;BORDER-LEFT:0px;DISPLAY:inline;BORDER-TOP:0px;BORDER-RIGHT:0px;" title="BarBitmap2" border="0" alt="BarBitmap2" src="http://community.softwarefx.com/blogs/wpf/BarBitmap2_thumb_6A45A828.png" width="240" height="148" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;If you have read other posts in this blog you know we like to refine our designs incrementally, so first we will add a shadow to each bar (this is why we started with a Canvas instead of using the Rectangle as the only visual in the template).&lt;/p&gt;&lt;pre class="code"&gt;&lt;span style="COLOR:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;DataTemplate&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
  &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Canvas&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
    &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Canvas.Resources&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
      &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;local&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;NegateConverter &lt;/span&gt;&lt;span style="COLOR:red;"&gt;x&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:red;"&gt;Key&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;negateConverter&amp;quot;/&amp;gt;
    &amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Canvas.Resources&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
    &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Rectangle &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Width&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;{&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Binding &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Path&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=Width}&amp;quot; &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Height&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;{&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Binding &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Path&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=Height}&amp;quot;&lt;br /&gt;                      &lt;span style="COLOR:red;"&gt;Fill&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;#404040&amp;quot; &lt;/span&gt;&lt;/span&gt;&lt;span style="COLOR:red;"&gt;Stroke&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;#404040&amp;quot;&lt;br /&gt;                      &lt;/span&gt;&lt;span style="COLOR:red;"&gt;StrokeThickness&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;{&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Binding &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Path&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=StrokeThickness}&amp;quot;&amp;gt;
      &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Rectangle.BitmapEffect&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
        &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;DropShadowBitmapEffect&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;/&amp;gt;
      &amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Rectangle.BitmapEffect&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
    &amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Rectangle&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
    &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Rectangle &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Canvas.Left&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;{&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Binding &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Path&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=Left,&lt;br /&gt;                                          &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Converter&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;={&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;StaticResource &lt;/span&gt;&lt;span style="COLOR:red;"&gt;negateConverter&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;}}&amp;quot;&lt;br /&gt;               &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Canvas.Top&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;{&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Binding &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Path&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=Top,&lt;br /&gt;                                    &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Converter&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;={&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;StaticResource &lt;/span&gt;&lt;span style="COLOR:red;"&gt;negateConverter&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;}}&amp;quot;&lt;br /&gt;               &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Width&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;{&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Binding &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Path&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=PlotWidth}&amp;quot; &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Height&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;{&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Binding &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Path&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=PlotHeight}&amp;quot;&lt;br /&gt;               &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Clip&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;{&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Binding &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Path&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=BoundsGeometry}&amp;quot;&amp;gt;
      &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Rectangle.Fill&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
        &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;ImageBrush &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Stretch&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;UniformToFill&amp;quot; &lt;/span&gt;&lt;span style="COLOR:red;"&gt;ImageSource&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;C:\Temp\WorldMap.png&amp;quot;/&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
      &amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Rectangle.Fill&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
    &amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Rectangle&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
  &amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Canvas&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
&amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;DataTemplate&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
&lt;/span&gt;&lt;/pre&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;
&lt;p&gt;Which gives us this&lt;/p&gt;
&lt;p&gt;&lt;a href="http://community.softwarefx.com/blogs/wpf/BarBitmap3_20D3536D.png"&gt;&lt;img style="BORDER-BOTTOM:0px;BORDER-LEFT:0px;DISPLAY:inline;BORDER-TOP:0px;BORDER-RIGHT:0px;" title="BarBitmap3" border="0" alt="BarBitmap3" src="http://community.softwarefx.com/blogs/wpf/BarBitmap3_thumb_563BEFC5.png" width="240" height="148" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If you asked me I would stop here but a coworker in the ChartFX for WPF team felt that depending on the value of the bars you might get to see too little of your bitmap, e.g. if the last 3 values were smaller than 20 you would not get to see much of the world map and maybe even lose the effect. If that is the case we could use the same bitmap in the plot area probably playing with the Opacity.&lt;/p&gt;&lt;pre class="code"&gt;&lt;span style="COLOR:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Chart.PlotArea&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
  &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;PlotAreaAttributes&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
    &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;PlotAreaAttributes.Background&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
      &amp;lt;&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;ImageBrush &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Opacity&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;0.35&amp;quot; &lt;/span&gt;&lt;span style="COLOR:red;"&gt;Stretch&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;UniformToFill&amp;quot;&lt;br /&gt;                           &lt;/span&gt;&lt;span style="COLOR:red;"&gt;ImageSource&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;=&amp;quot;C:\Temp\WorldMap.png&amp;quot; /&amp;gt;&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;
    &amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;PlotAreaAttributes.Background&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
  &amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;PlotAreaAttributes&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;
&amp;lt;/&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;cfx&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;:&lt;/span&gt;&lt;span style="COLOR:#a31515;"&gt;Chart.PlotArea&lt;/span&gt;&lt;span style="COLOR:blue;"&gt;&amp;gt;&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;&lt;a href="http://community.softwarefx.com/blogs/wpf/BarBitmap4_05AA5E92.png"&gt;&lt;img style="BORDER-BOTTOM:0px;BORDER-LEFT:0px;DISPLAY:inline;BORDER-TOP:0px;BORDER-RIGHT:0px;" title="BarBitmap4" border="0" alt="BarBitmap4" src="http://community.softwarefx.com/blogs/wpf/BarBitmap4_thumb_2C684F05.png" width="240" height="147" /&gt;&lt;/a&gt; &lt;/p&gt;
&lt;p&gt;JuanC&lt;/p&gt;&lt;img src="http://community.softwarefx.com/aggbug.aspx?PostID=25593" width="1" height="1"&gt;</content><author><name>JuanC</name><uri>http://community.softwarefx.com/members/JuanC.aspx</uri></author><category term="HOWTO" scheme="http://community.softwarefx.com/blogs/wpf/archive/tags/HOWTO/default.aspx" /><category term="Styling" scheme="http://community.softwarefx.com/blogs/wpf/archive/tags/Styling/default.aspx" /><category term="ImageBrush" scheme="http://community.softwarefx.com/blogs/wpf/archive/tags/ImageBrush/default.aspx" /></entry></feed>