p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   C# (http://p2p.wrox.com/forumdisplay.php?f=22)
-   -   MSChart Help with 3D Bar (http://p2p.wrox.com/showthread.php?t=63565)

eusanpe November 6th, 2007 04:41 PM

MSChart Help with 3D Bar
 
Hello All:

I am trying to use MSChart and I would like to ask for help on a question. I am able to get a chart listed but it isn't like I want. Basically the chart prints the following:

X Axis - Date and Test
Y Axis - The Result

The Y-Axis is doing fine with the result. I would like only the date on the X-axis and the two tests that print up on the Z-axis. I am using a 3d bar chart.

Thank you..
Tony

My piece of code is below..
======================================

try
{
 SqlCommand cmd = new SqlCommand(
    "Select Count(*) " +
    "From LabDB " +
        "Where l.name in ('HGB', 'HCT') ",conn);

 int arraySize = Convert.ToInt32(cmd.ExecuteScalar());

 cmd.CommandText = "Select l.dtm as resultDate, " +
            itemname = case " +
                                "when l.name = 'HGB' " + "then 'Hemoglobin' " +

            "when l.name = 'HCT' " +
                                    "then 'Hematocrit' " +

            "end, " + "l.value as result " +
            "From LabDB " +
                    "Where l.name in ('HGB', 'HCT') ",conn);
            "Order by l.resultDate desc, itemname ";

SqlDataReader dr = cmd.ExecuteReader();

string [,] ptInfo = new string [arraySize, 2];
int i = 0;

if ( null != dr )
{
     while (dr.Read() & i < arraySize)

     {
    ptInfo[i, 0] = dr["itemname"].ToString();
    ptInfo[i, 1] = dr["resultDate"].ToString();
    ptInfo[i, 2] = dr["result"].ToString();

    axMSChart1.ChartData = ptInfo;
    i += 1;
      }
      dr.Close();
}
}


All times are GMT -4. The time now is 01:07 AM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.