Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8224671
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T15:09:11+00:00 2026-06-07T15:09:11+00:00

I have a very wierd issue with style of Silverlight Charting controls. When I

  • 0

I have a very wierd issue with style of Silverlight Charting controls. When I create a DataPointStyle for anyseries It ignore the existing default color combination. It starts showing me same(orange) color for everything even I haven’t set anything in the background of DataPointStyle.

What I want is to create some custom tooltip and leave the background as it is. But its not working for me. Any suggestion is much appreciated.

Cheers!

Vinod

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T15:09:13+00:00Added an answer on June 7, 2026 at 3:09 pm

    I think the trick is not to apply the data-point style to the chart itself, but rather to the individual colours that make up the palette.

    I started with the following, which uses a PieChart. The same principles should apply when using other types of chart:

    <UserControl x:Class="ChartPaletteDemo.MainPage"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:toolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit"
        mc:Ignorable="d"
        d:DesignHeight="300" d:DesignWidth="400">
        <UserControl.Resources>
            <Style x:Key="pointStyle" TargetType="toolkit:DataPoint">
                <Setter Property="DependentValueStringFormat"
                        Value="The value is {0:N0}" />
                <Setter Property="RatioStringFormat" Value="" />
            </Style>
        </UserControl.Resources>
    
        <toolkit:Chart>
            <toolkit:Chart.Series>
                <toolkit:PieSeries ItemsSource="{Binding Path=Data}"
                                   IndependentValueBinding="{Binding Path=Key}"
                                   DependentValueBinding="{Binding Path=Value}"
                                   DataPointStyle="{StaticResource pointStyle}" />
            </toolkit:Chart.Series>
        </toolkit:Chart>
    </UserControl>
    

    This gave me a pie chart with the customised tooltip text but with all segments orange.

    The next step is to set a custom palette. A palette used by the Silverlight Toolkit charts is a ResourceDictionaryCollection, with each contained ResourceDictionary representing a colour within the palette. You can find the ‘default’ palette for the chart within Themes\generic.xaml in the assembly System.Windows.Controls.DataVisualization.Toolkit. You can use a tool such as Blend or ILSpy to get at this palette.

    I took this ‘default’ palette, and:

    • removed all of the setters for the DataShapeStyle (I’m not sure they’re necessary, but you can keep them if you wish),
    • changed the TargetType of each DataPointStyle from Control to toolkit:DataPoint, and
    • added BasedOn="{StaticResource pointStyle}" to each DataPointStyle.

    This last point is what sets up the custom tooltip format with each palette entry.

    This left me with something like the following, which I added to <UserControl.Resources>:

        <toolkit:ResourceDictionaryCollection x:Key="chartPalette">
            <!-- Blue -->
            <ResourceDictionary>
                <RadialGradientBrush x:Key="Background" GradientOrigin="-0.1,-0.1"
                                     Center="0.075,0.015" RadiusX="1.05"
                                     RadiusY="0.9">
                    <GradientStop Color="#FFB9D6F7" />
                    <GradientStop Color="#FF284B70" Offset="1" />
                </RadialGradientBrush>
                <Style x:Key="DataPointStyle" TargetType="toolkit:DataPoint"
                       BasedOn="{StaticResource pointStyle}">
                    <Setter Property="Background"
                            Value="{StaticResource Background}" />
                </Style>
            </ResourceDictionary>
            <!-- other styles copied similarly, but omitted for brevity -->
       </toolkit:ResourceDictionaryCollection>
    

    I then removed DataPointStyle="{StaticResource pointStyle}" from the PieSeries and added Palette="{StaticResource chartPalette}" to the <toolkit:Chart> element instead. When I ran the application I got the four segments of the pie to use different colours.

    Acknowledgement: most of this has been taken from atomlinson’s post on the Silverlight forums at http://forums.silverlight.net/post/330170.aspx.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a very weird issue. I have a UserControl that has some controls
I have ran into a very strange issue with Google Maps in Chrome 5.0.375.99:
I have this very annoying issue, whenever i call a function: void renderGame::renderMovingBlock(movingBlock* blockToRender){
Very strange issue... I have something like this in my Controller: public ActionResult Initialize(IEnumerable<MyModel>
This is a very wierd issue - any thoughts/help/hints would be greatly appreciated. Our
It is very weird, and I don't have any idea what is the issue!
I have this very weird issue that I cant really get why it's not
So I have a very weird issue in which that when I run my
I'm having a very weird issue here, I have set-up my solr architecture as
Since iOS6 I have a very weird issue with UIImages that causes the application

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.