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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T15:21:39+00:00 2026-06-17T15:21:39+00:00

I am confounded by this problem: I have a WinForm with ZedGraph object plotting

  • 0

I am confounded by this problem: I have a WinForm with ZedGraph object plotting a simple curve. It has a custom text object “C” above each point. When I change the XAxis.Type to DateAsOrdinal, the “C” text label disappears. How can I get “C” with DateAsOrdinal to work?

The code is below for anyone to try:

    private void DrawChart( ZedGraphControl zGraph ) {
        GraphPane pane = zGraph.GraphPane;
        pane.Title.Text = "My Sample Test";
        pane.XAxis.Title.Text = "Date";
        pane.YAxis.Title.Text = "Price";

        // Uncomment below line: all "C" labels disappear!
        //pane.XAxis.Type = AxisType.DateAsOrdinal;

        double x, y;
        PointPairList points = new PointPairList();
        DateTime day = new DateTime( 2012, 1, 1 );

        for ( int i = 0 ; i < 36 ; i++ ) {
            x = day.ToOADate();
            y = 1.5 + Math.Sin( (double)i * 0.2 );
            points.Add( x, y );

            // this label disappears when XAxis.Type = DateAsOrdinal!
            TextObj text = new TextObj( "C", x, y + 0.1, CoordType.AxisXYScale, AlignH.Center, AlignV.Center );
            text.ZOrder = ZOrder.A_InFront;
            text.FontSpec.Border.IsVisible = false;
            pane.GraphObjList.Add( text );

            day = day.AddDays( 1 );   // goto next day (x-coord)
        }

        LineItem curve = pane.AddCurve( "Stock", points, Color.Black, SymbolType.None );

        zGraph.AxisChange();
    }
  • 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-17T15:21:41+00:00Added an answer on June 17, 2026 at 3:21 pm

    Try

    new TextObj(“C”, i + 1, y + …..

    Ordinal XAxis means as expression implies that x values will run 1, 2, 3…

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

Sidebar

Related Questions

This problem has been bothering me for sometime now, I have not settled on
I've got a simple question but it has got me confounded. The code below
I know this has been asked but I'm still confounded. I'm trying to build
Well I have been trying this problem for over 10 hours and have no
This one has me confounded, so I'll try to go through the chronology so
I am confounded with a strange issue. Basically the situation is like this. I
I have custom buttons in the nav bar, I want to toggle their state
I don't know if this applies to Android or iPhone. I have an Android
I have run into ...I don't think I would call it a problem as
I'm working on my first java project, and I've been confounded. This opens 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.