Chart tweaking made easy [How to: Make four simple color/ToolTip changes with Silverlight/WPF Charting]
**
This blog has moved to a new location and comments have been disabled.
All old posts, new posts, and comments can be found on The blog of dlaa.me.
See you there!
Comments
Anonymous
May 20, 2009
PingBack from http://blogs.msdn.com/delay/archive/2009/05/19/chart-tweaking-made-easy-how-to-make-four-simple-color-tooltip-changes-with-silverlight-wpf-charting.aspxAnonymous
May 20, 2009
Great post! :) There were some things I still wasn't understanding quite well, but your post made it all clear for me. I'll play around with it now and see what else I can do. I see that I can change the chart background by redefining the PlotAreaStyle setter value, or change the border, legend or title styles. Great! Thanks again for this post :) Cheers, PauloAnonymous
May 21, 2009
UPDATE: If you are looking to follow this series, be sure to subscribe to my RSS feed at http://feedsAnonymous
May 21, 2009
UPDATE: If you are looking to follow this series, be sure to subscribe to my RSS feed at http://feeds.jasongaylord.com/JasonNGaylordAnonymous
June 08, 2009
…eine Sammlung von Infos und interessanter Links rund um das Thema Silverlight, zusammengestellt ausAnonymous
June 30, 2009
Thanks for the info but when I try to open the ChartStylingScenarios, it says that: "The project type is not supported by this installation." Note that I do not have Silverlight installed because the machines i'm developing for will not have it either and I don't want to include anything that won't run on their machines. I'm working on a WPF application. Thanks for any info on this.Anonymous
July 01, 2009
coolduds, That's expected behavior - ChartStylingScenarios is a Silverlight (only) project. But I've got good news for you! :) The DataVisualizationDemos solution I link to in the following post includes this sample and has projects for both Silverlight and WPF. http://blogs.msdn.com/delay/archive/2009/06/25/wpf-charting-it-s-official-june-2009-release-of-the-wpf-toolkit-is-now-available.aspx You should be able to open that solution, ignore the failure to read the Silverlight project, and then build, run, and analyze the WPF project just fine! Hope this helps!Anonymous
June 10, 2010
Thanks for the great post! I was just wondering about the data-binding in your charting examples - I understand the ItemsSource and the DependingValueBinding, but what does the backing data look like such that IndependentValueBinding="{Binding}" results in 'this' 'is' 'sample' 'data' in the chart? ItemsSource="{Binding}" DependentValueBinding="{Binding Length}" IndependentValueBinding="{Binding}">Anonymous
June 10, 2010
sorry nevermind the previous comment - just found the link to the source - didn't see it earlier somehow :)Anonymous
December 23, 2010
Hi delay, how do you do the Custom ToolTip (Pie) now in SL 4 toolkit April 2010 release? They don't have the datavis:StylePalette palette anymore. thanks.Anonymous
December 24, 2010
The comment has been removedAnonymous
August 26, 2011
Wondering how to display the series title instead of "Custom ToolTip"?Anonymous
August 27, 2011
Joe, The DataContext of the ToolTip is a DataPoint instance. With luck (or maybe a bit of work on your part), it'll be possible to get to the Series instance from that DataPoint instance. After that, you can reference the Series's Title property and you should be set. Hope this helps!Anonymous
September 05, 2011
David, How do we apply text on the pie chart slices and on column tops.?Anonymous
September 06, 2011
Rajesh: For the latter, please have a look at this post: blogs.msdn.com/.../simple-column-labels-you-can-create-at-home-re-templating-the-silverlight-wpf-data-visualization-columndatapoint-to-add-annotations.aspx For the former, have a look at the posts by Bea here: http://cesso.org/r/DVLinks Hope this helps!Anonymous
October 23, 2011
Hi David, Like Joe up above, I'm also trying to get the series title inside of the tooltip for a DataPoint. You said above that it is possible to get the series instance from the DataPoint instance, which makes sense. I seem to be having trouble getting a template for a DataPoint to reference it's parent Series. Everything I try results in a blank tooltip. Can you offer any help on how do do this? Thanks for any info. GrantAnonymous
October 23, 2011
Grant, If you're not having any luck with what's available by default, you may need to either subclass the Series and expose the Series instance via the DataPoint's Tag property or else modify the DataVis code a bit to expose a dedicated property for that purpose. Other than that, you might have the easiest time diagnosing data binding issues on WPF where the diagnostic messages (via the debug output window) are rather helpful. Sorry for the trouble - I hope this helps!Anonymous
January 02, 2012
can i show the Column of "ColumnSeries" in different color? like i have 3 options as 3 column of a column series. yes:-5 no:-2 don't know:8 can i show: 'yes' column in "Green' color 'no' column in "red' color 'don't know' column in "Amber' color Thanks in Advance!!Anonymous
January 03, 2012
kamlendra, I think the following post shows how to do what you want using an MVVM approach: blogs.msdn.com/.../columns-of-a-different-color-customizing-the-appearance-of-silverlight-charts-with-re-templating-and-mvvm.aspx FYI that you can find more helpful posts about Data Visualization here: http://cesso.org/r/DVLinks Hope this helps!Anonymous
August 10, 2012
Can anyone please let me know, how to change the color of an area at runtime? I've tried setting style as Style styleListBoxItem = new Style(typeof(ColumnSeries)); styleListBoxItem.Setters.Add(new Setter(ColumnSeries.BackgroundProperty, new SolidColorBrush(Colors.Blue))); but this didn't work out. Thanks.Anonymous
August 10, 2012
Raj, If you're trying to implement the first example in code, please note that you should be setting the ColumnSeries.DataPointStyle property (not the Background).Anonymous
June 06, 2013
Hello there, ive implemented a custom LegendItem (with checkBoxes to change the visibility of the Graph) but now i've got the Problem, that i need to access the default color so that i can add them to the legend. (Ive got multiple Graphs in different colors) . I want to change the fill property of a rectangle to this default DataPoint color. I hope someone can help me! Thank youAnonymous
June 07, 2013
Alex, From what I understand of your scenario, this isn't much different from how the default LegendItems get the right color for their series, is it? If so, please have a look at the existing implementation - particularly the XAML if I recall correctly - for some ideas on how to get this working. Hope this helps!Anonymous
November 18, 2013
The comment has been removedAnonymous
November 18, 2013
The comment has been removedAnonymous
November 18, 2013
The comment has been removedAnonymous
November 18, 2013
The comment has been removedAnonymous
November 18, 2013
The comment has been removedAnonymous
November 18, 2013
The comment has been removedAnonymous
November 18, 2013
The comment has been removedAnonymous
November 18, 2013
The comment has been removedAnonymous
November 18, 2013
David, THANKS! Finally works. I have no idea why when i apply the style from silverlight.codeplex.com/.../latest the points do not show up, but when i applied your style template the points show up as squares and the tool-tip too. I had spend at least 3 days trying to figure this out. I am glad that there is people that are willing to help others. A thousand thanksAnonymous
November 19, 2013
The comment has been removedAnonymous
December 30, 2013
How to print a value on piechart, below is the code which I am using <charting:PieSeries.DataPointStyle > </charting:PieSeries.DataPointStyle>Anonymous
March 25, 2014
Nice post! For the Column chart, I don't see StylePalette in ColumnSeries WPF4? What is the alternative? ThanksAnonymous
March 25, 2014
Nice Post! For WPF4, I don't see in StylePalette in ColumnSeries? What's the alternatives? ThanksAnonymous
March 26, 2014
tle, Colors for ColumnSeries can be specified directly - as shown in the post above. The palette is only needed by PieSeries where a single series might display using multiple colors.