Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
Password Reminder
Register
| FAQ | Members List | Calendar | 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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
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();
}
}
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



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


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