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

  • SEARCH
  • Home
  • 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 6866357
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T03:10:24+00:00 2026-05-27T03:10:24+00:00

I have used Jim McCurdy’s very helpful answer to this StackOverflow question to avoid

  • 0

I have used Jim McCurdy’s very helpful answer to this StackOverflow question to avoid drawing data points in a WPF Toolkit chart with multiple line series.

However: if I do not apply Jim’s XAML styles, all chart lines obtain different colors (of course at the expense of data points being displayed), but when I apply the “datapoint-less” styles the line color is constant, resulting in all lines in the chart having the same color.

Is it possible to extend the XAML styles so that the line colors is automatically different for each new line series in the chart?

If I interpret the answer to this StackOverflow question correctly, the problem is fairly easily solved programmatically, but if possible I would prefer an XAML based solution.

  • 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-05-27T03:10:25+00:00Added an answer on May 27, 2026 at 3:10 am

    For solving this problem in XAML, one way is to create a different DataPoint style for each color that you want to be assigned to a LineSeries. For example, I’ve simply done this:

    <Style x:Key="InvisibleDataPointBlue" TargetType="{x:Type charting:DataPoint}">
        <Setter Property="Background" Value="Blue"/>
        <Setter Property="Template" Value="{x:Null}"/>
    </Style>
    
    <Style x:Key="InvisibleDataPointRed" TargetType="{x:Type charting:DataPoint}">
        <Setter Property="Background" Value="Red"/>
        <Setter Property="Template" Value="{x:Null}"/>
    </Style>
    
    <Style x:Key="InvisibleDataPointGreen" TargetType="{x:Type charting:DataPoint}">
        <Setter Property="Background" Value="Green"/>
        <Setter Property="Template" Value="{x:Null}"/>
    </Style>
    

    There may be a better way to dynamically assign a new color, but if your needs are modest, this will do.

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

Sidebar

Related Questions

I have used this in my HTML: <q> Hai How r u </q> Which
I have used an ObservableCollection with WPF for binding and this works well. What
I have used .NET 3.5 with C# to create functions to gather data from
I have used this php to fetch my blog's latest post: function read_rss($display=0,$url='') {
I have used some TCL, but this construction stumps me. When $res = Table
I have used alias ruby=ruby1.9.1, so I can execute my ruby with this: ruby
I have used this code to send mails but I am not getting any
I have used this summary reference for years but it is beginning to show
I have used the signalR chat app (as laid out in this tutorial http://sergiotapia.com/2011/09/signalr-with-mvc3-chat-app-build-asynchronous-real-time-persistant-connection-websites/
I have used traditional version control systems to maintain source code repositories on past

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.