MSDN > 論壇首頁 > Chart Controls for .NET Framework > Display dates on X-axis
發問發問
 

已答覆Display dates on X-axis

  • Tuesday, 30 June, 2009 16:17Bandaru30 使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     
    Hi,
         I have to plot a chart based on three columns, first column consists of dates which may be reoccuring in the column, second column has status and third column has count. I am just databinding the table column for the series based on status and the resulting chart is totally bad where the dates are reoccuring and all messed up.

    Table..
    Date           Status                   Value
    05/21/09     New                        3
    05/22/09     Order Placed            5
    05/22/09     Order approved        3
    05/23/09     Returned                  1
    05/23/09     Closed                     3
    05/24/09     Closed                     2

    So if I use the above table, I get the chart but the dates 22 and 23 are appearing twice on the X-axis with normal interval. How should I program if the dates are same. Any Help is much appreciated and Thanks a lot for your Help.

    Regards,
    Bandaru
    •  

解答

  • Wednesday, 1 July, 2009 16:45Nader Nashed MSFTMSFT使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     已答覆
    I am assuming you need to create a series for each status type in your Status Column and have your Y value as your Value column

    The follwing API should work, it will group the series by Status and set the X value to Date and Y value to Value
    chart1.DataBindCrossTable(datasource,

    "Status", "Date","Value", "");

所有回覆

  • Wednesday, 1 July, 2009 16:45Nader Nashed MSFTMSFT使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     已答覆
    I am assuming you need to create a series for each status type in your Status Column and have your Y value as your Value column

    The follwing API should work, it will group the series by Status and set the X value to Date and Y value to Value
    chart1.DataBindCrossTable(datasource,

    "Status", "Date","Value", "");