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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T19:42:23+00:00 2026-05-17T19:42:23+00:00

I have successfully used the C++ example project to draw graphs from my C++

  • 0

I have successfully used the C++ example project to draw graphs from my C++ project using ZedGraph. However there is no example with Date axis for C++.

The following code is taken from the C# example found at
http://zedgraph.org/wiki/index.php?title=Tutorial:Date_Axis_Chart_Demo. Please see my comments with the text //JEM// to see where my problem is

    PointPairList list = new PointPairList();
    for ( int i=0; i<36; i++ )
    {
        double x = (double) new XDate( 1995, 5, i+11 );

        >  //JEM //This line above doesn't work in
        > C++.

        double y = Math.Sin( (double) i * Math.PI / 15.0 );
        list.Add( x, y );
    }

    ....missing code...

    // Set the XAxis to date type
    myPane.XAxis.Type = AxisType.Date;

    //JEM //This one also doesn't work even if I change it to the
    //syntax that C++ understands, that is,
    myPane->XAxis->Type = AxisType->Date;
  • 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-17T19:42:23+00:00Added an answer on May 17, 2026 at 7:42 pm

    Thanks Gacek.
    This is how it finally went down. Your answer was the turning point!!!

        for ( int i = 0; i < basin.DY; i++ ){
               XDate dato(1995,9,i,0,0,0); //date
               double x = (double)dato;
                //double x =  i;     
               double y =  basin.Qsim[i];     
               double y2 = basin.Qobs[i];     
                list->Add( x, y );     
                list2->Add( x, y2 );
        }
        //set the XAXis to date type
        myPane->XAxis->Type = AxisType::Date;
    

    here is the constructor for the Xdate type for c++ from sourceforge dot net documentation/html/M_ZedGraph_XDate__ctor_3.htm.
    XDate (int year, int month, int day, int hour, int minute, double second)

    I have also found a detailed example on this link http://www.c-plusplus.de/forum/viewtopic-var-t-is-186422-and-view-is-next.html
    with the following code

            /// ZedGraph Kurve //////////
    private: void CreateGraph( ZedGraphControl ^zgc )
    {
       GraphPane ^myPane = zgc->GraphPane;
    
       // Set the titles and axis labels
       myPane->Title->Text = "Gewichtskurve";
       myPane->XAxis->Title->Text = "Tag";
       myPane->YAxis->Title->Text = "Gewicht in Kg";
    
    
       // Make up some data points from the Sine function
        double x,y;
       PointPairList ^list = gcnew PointPairList();
       for ( int i=0; i<36; i++ )
       {
         x = (double) gcnew XDate( 1995, 5, i+11 );
          y = Math::Sin( (double) i * Math::PI / 15.0 );
          list->Add( x, y );
       }
    
       // Generate a blue curve with circle symbols, and "My Curve 2" in the legend
           LineItem ^myCurve = myPane->AddCurve( "Trainingskurve", list, Color::Blue,
           SymbolType::Circle );
    
           XDate ^xdatum = gcnew XDate ( 1995, 1, 1);
           xdatum->AddDays ( 1 );
    
           myPane->XAxis->Type = AxisType::Date;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have successfully created the message queue by using the following command: msgIdHareTurtle =
What various methods and technologies have you used to successfully address scalability and performance
I have successfully connected to an Oracle database (10g) from C# (Visual Studio 2008)
using the Code Snippet for sending email in VB.Net I have successfully sent an
I have a project which I have used Active Record and which I'd like
I'm trying to digitally sign a PDF file using THIS project as an example.
I have successfully used the Excel and Word addin templates in Visual studio 2008
I have a Rails app that I have successfully tested with Mongrel and Webkit.
I believe that I have successfully impersonated my own user account while running an
I'm familiar with the LAMP stack and over the years have successfully deployed 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.