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 7534549
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T06:03:06+00:00 2026-05-30T06:03:06+00:00

I have created a WPF chart programmatically and would like to change the Title’s

  • 0

I have created a WPF chart programmatically and would like to change the Title’s Font and color, I can set the chart’s width and height but not the title, all the examples that I have found online show you how to do it through XAML. but I need to be able to do it all in code.

        this._chart.Width = this.ChartWidth;
        this._chart.Height = this.ChartHeight;
        this._chart.Background = Brushes.Transparent;
        ....
        this._chart.Title ????

Thank you.

  • 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-30T06:03:08+00:00Added an answer on May 30, 2026 at 6:03 am

    The easiest way is to use the TextBlock control instead of the plain text:

    this._chart.Title = new TextBlock 
    { 
        Text = "My title", 
        FontFamily = new FontFamily("Arial"), 
        Foreground = Brushes.Red 
    };
    

    The same approach can be used with the legend title. By the way you can use any WPF control, not only the text block.

    this._chart.LegendTitle = new TextBlock { Text = "legend", Foreground = Brushes.Red };
    

    If you want to change a style property like PloatAreaStyle, do it so:

    var plotAreaStyle = new Style(typeof(Grid));
    plotAreaStyle.Setters.Add(new Setter(Grid.BackgroundProperty, Brushes.LightBlue));
    
    this._chart.PlotAreaStyle = plotAreaStyle;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a wpf application ,there are two canvas i would like to
I've created a chart using the WPF toolkit (3.5) charting toolkit and I can't
I have created a WPF tooklit datagrid in C# and the ItemsSource is set
I have created successfully a wpf user control inheritance like this: <base:BaseUserControl x:Class=wpfcontrolinheritance.InheritedUserControl xmlns=http://schemas.microsoft.com/winfx/2006/xaml/presentation
I have created WPF MVVM application, and set WPFToolkit DataGrid binding to DataTable so
I have created some tests in my WPF application. Right now I am working
I have created styled a ListBox in WPF so that it is rendered as
We have created a beautifully designed .NET WPF desktop application. We are installing the
I am playing with wpf and when i have created database it is created
I have a WPF Path object which is created by reading nodes from a

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.