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

The Archive Base Latest Questions

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

I have a C# windows form with a simple 2D line chart that I

  • 0

I have a C# windows form with a simple 2D line chart that I want to add custom X or Y axis markers to, and draw a custom grid line (in a highlighted color, dotted line for example). I have looked at the customLabels property, but this seems to override the default grid, which I still want to display. This is to illustrate something like a threshold or a cutoff. How can I do this with the MSChart control?

Many thanks

  • 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-24T03:51:28+00:00Added an answer on May 24, 2026 at 3:51 am

    Could you achieve what you want with striplines?

    In the ms chart samples (get it here http://archive.msdn.microsoft.com/mschart), inside the “Using Custom Labels” section, they use striplines on the Y axis which are quite effective at highlighting ranges of values. They also do not affect the grid … I checked that by changing the sample code a little so I could easily move the boundaries of the striplines around (see below).

    double low_med = 17; // was 30
    double med_hi = 92;  // was 70
    
    // Set Y axis custom labels
    axisY.CustomLabels.Add(0, low_med, "Low");
    axisY.CustomLabels.Add(low_med, med_hi, "Medium");
    axisY.CustomLabels.Add(med_hi, 100, "High");
    
    StripLine stripLow = new StripLine();
    stripLow.IntervalOffset = 0;
    stripLow.StripWidth = low_med;
    stripLow.BackColor = Color.FromArgb(64, Color.Green);
    
    StripLine stripMed = new StripLine();
    stripMed.IntervalOffset = low_med;
    stripMed.StripWidth = med_hi - low_med;
    stripMed.BackColor = Color.FromArgb(64, Color.Orange);
    
    StripLine stripHigh = new StripLine();
    stripHigh.IntervalOffset = med_hi;
    stripHigh.StripWidth = 100 - med_hi;
    stripHigh.BackColor = Color.FromArgb(64, Color.Red);
    
    axisY.StripLines.Add(stripLow);
    axisY.StripLines.Add(stripMed);
    axisY.StripLines.Add(stripHigh);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple Windows Form that hosts property controls at runtime. When the
I have a simple .NET 2.0 windows form app that runs off of a
I have a simple Windows Form application that is using the .net 3.5 compact
I have a Windows Form and a class with two simple methods that run
I have a simple windows form app that I need to get the file
I have a simple windows application in C# with 3 forms. first form is
I have a Windows Form that takes quite a bit of time to load
I have a windows form application that uses a Shared class to house all
All, I have a simple windows form with a combobox and a 'OK' button.
I have a Windows Form, which is a modal mdi child, that is suppose

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.