View Single Post
  #1 (permalink)  
Old November 6th, 2007, 04:41 PM
eusanpe eusanpe is offline
Authorized User
Points: 336, Level: 6
Points: 336, Level: 6 Points: 336, Level: 6 Points: 336, Level: 6
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Sep 2006
Location: , , .
Posts: 73
Thanks: 6
Thanked 0 Times in 0 Posts
Default 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();
}
}
Reply With Quote