.Net Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming Languages - More.Net Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old October 15th, 2012, 06:04 PM
Grimey Grimey is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2011
Posts: 14 Grimey User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 h 25 m 27 sec
Reputation Power: 0
Problem binding data row to chart

Hi all! I am totally new to the Chart object found in Windows.Forms.Datavisualization. I have found some tutorials around on the net, but none of them seem instructive regarding the issue I am having.

I am using VB.NET, querying from a database, and the result is always a single row with 7 columns, each having an integer value. I want the values returned in the row displayed in vertical bars with height matching the value returned, with each column's value spaced out along the X axis.

Every tutorial I've come across has been set up to have the values retrieved from successive rows in a dataset. I have tried using the Series.Points.AddXY() function to manually map the values, but that isn't quite working right either.

Code:
Dim row As DataRow = ds.Tables(0).Rows(0)
            chtForecast.Series(0).Points.AddXY(1, row.Item("Tomorrow"))
            chtForecast.Series(0).Points.AddXY(2, row.Item("Day2"))
            chtForecast.Series(0).Points.AddXY(3, row.Item("Day3"))
            chtForecast.Series(0).Points.AddXY(4, row.Item("Day4"))
            chtForecast.Series(0).Points.AddXY(5, row.Item("Day5"))
            chtForecast.Series(0).Points.AddXY(6, row.Item("Day6"))
            chtForecast.Series(0).Points.AddXY(7, row.Item("Day7"))


For some reason the above code causes only one bar (column) to be drawn, and I have confirmed that it is the height of the largest value returned in the row.

If someone could help out with this, or even point me toward a more comprehensive review of the functionality of this Chart object, that would be much appreciated.

Reply With Quote
  #2  
Old October 19th, 2012, 05:23 PM
Grimey Grimey is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2011
Posts: 14 Grimey User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 h 25 m 27 sec
Reputation Power: 0
Problem is now gone

I'm not sure why this solved the problem, but I removed some dummy data from the chart that I'd entered in the designer interface in VS2010. Once I did that, everything came up correctly. I suppose the issue was that I was adding points whose values were the same as points already in the series.

Reply With Quote
  #3  
Old December 19th, 2012, 11:45 PM
pareshaegis pareshaegis is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2012
Posts: 5 pareshaegis User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 34 m 26 sec
Reputation Power: 0
Re:-

Hi Guys.

I am From Outsource . net And SharePoint Development Company. We Provide Custom Word Wide SharePoint Development And .Net Development service as per client requirement.

All your comment for SharePoint Development And . net Development are welcome.

Thanks.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - More.Net Development > Problem binding data row to chart

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap