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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T03:43:15+00:00 2026-05-18T03:43:15+00:00

I have a table that has date and datasize. When I export the list

  • 0

I have a table that has date and datasize. When I export the list its data appears as

11/1/10|1  
11/2/10|2  
11/3/10|16  

I simply want to create a line graph from this data, but when I see if it’s plotted or not the graph is never plotted, also is there a way to change the x axis from a 0-100 numbering to the dates that are listed?

private void CreateGraph_DataSource(ZedGraphControl zedGraphControl1)
{
    string project = listBox1.SelectedItem.ToString();
    string sql = "select date,datasize from dbo.x where project = '"+project+"' order by date";
    DataTable projects = null;
    SqlDataAdapter dataadapt = null;
    SqlConnection con = new SqlConnection("Data Source= W ;Initial Catalog= ding;Integrated Security= SSPI");
    con.Open();
    SqlCommand cmd = new SqlCommand(sql, con);
    cmd.ExecuteNonQuery();
    projects = new DataTable();
    dataadapt = new SqlDataAdapter(cmd);
    dataadapt.Fill(projects);
    con.Close();
    GraphPane myPane = zedGraphControl1.GraphPane;
    myPane.Title.Text = project;
    myPane.YAxis.Title.Text = "Size";
    myPane.XAxis.Title.Text = "Date";
    DataSourcePointList dsp = new DataSourcePointList();
    dsp.DataSource = projects;
    dsp.XDataMember = "Date";
    dsp.YDataMember = "DataSize";
    LineItem myCurve = myPane.AddCurve("DataSize", dsp, Color.DarkViolet);
    myCurve.Line.Fill = new Fill(Color.Red, Color.White);
    LineItem myCurve2 = myPane.AddCurve("Date", dsp, Color.DarkViolet);
    myCurve2.Line.Fill = new Fill(Color.Green, Color.White);
    myCurve.Line.Width = 2.0F;
    myCurve2.Line.Width = 2.0F;
    zedGraphControl1.AxisChange();
    myPane.XAxis.Type = AxisType.Date;
}

Edit:

Sorry, it does appear to be graphing but the scaling is really bad, is there a way to set the scaling to start?

Solved.

  • 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-18T03:43:15+00:00Added an answer on May 18, 2026 at 3:43 am

    You need to tell ZedGraph that the axis is a date type:

    myPane.XAxis.Type = AxisType.Date;
    

    While it doesn’t use a DataSource there is a tutorial on using the Date Axis Type.

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

Sidebar

Related Questions

i have a table that has event name and event date. if i want
I have a table that has redundant data and I'm trying to identify all
I have a table in MySQL that has 3 fields and I want to
I have table that has date field. When I run a query, I see
I have a table that has a date, item, and quantity. I need a
i have a table that has a date/time field when i display the report,
I have a table that has three different date columns, so I set each
I have a table that has multiple records with a start date (PlacementDate) and
I have a table that has ordernumber, cancelled date and reason. Reason field is
Let's say I have a table that has user_id, date, score, and every user

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.