Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
| Search | Today's Posts | Mark Forums Read
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 6th, 2007, 04:41 PM
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();
}
}




Similar Threads
Thread Thread Starter Forum Replies Last Post
How do disable Menu bar & address bar for browser bekim HTML Code Clinic 2 January 7th, 2005 12:33 AM
MsChart-Connection blackdevil1979 VB Databases Basics 0 September 24th, 2004 04:54 AM
How to trap Mouse events on Title bar/Caption bar chiefouko Pro VB.NET 2002/2003 0 September 21st, 2004 02:42 AM
Bar Chart with Item names beside bar jmurdock BOOK: Professional SQL Server Reporting Services ISBN: 0-7645-6878-7 0 July 23rd, 2004 01:05 PM
MSChart - Populating Data kasie Beginning VB 6 1 June 11th, 2003 06:00 AM





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