MSChart Row Labels help!

I have a graph "ChtLive" that updates constantly based on values coming in 
from PLC. The graph updates fine and displays my values on the screen 
perfectly.  However, I am having trouble with the row labels (rows 1-20) 
updating as current time in VB6.  

Ex:  This function SHOULD do the following:

First time around, row label 20 holds current time. 

  frmMain.chtLive.Row = 20
  frmMain.chtLive.RowLabel = Format(Now(), "ss") 'seconds on the minute
    
Second time the function in question is called, row 19 label takes value 
from row 20 label, and row 20 received new current time. 

Third time around row 18 label takes the value from row label 19, and row 
label 19 takes value from row 20 label, and row 20 label receives new Current 
time.   

Note:  After row label 1 receives the old time from row label 2 and displays 
it, it should then drop off and delete, making room for next value.....like a 
realtime line graph. 


Does anybody know how to do this?  You don't have to even know about 
graphs...I think it's done with passing values between arrays but I can't 
seem to wrap my head around this to implement it. Any Ideas Anyone? Please 
help!! Thanks!

Brad
0
Utf
3/25/2010 2:01:01 PM
vb.general.discussion 1016 articles. 0 followers. Follow

1 Replies
1552 Views

Similar Articles

[PageSpeed] 9

"BadLannon" <BadLannon@discussions.microsoft.com> skrev i meddelandet 
news:FE8B9595-1CB6-4329-AA37-62AFF02FB463@microsoft.com...
>I have a graph "ChtLive" that updates constantly based on values coming in
> from PLC. The graph updates fine and displays my values on the screen
> perfectly.  However, I am having trouble with the row labels (rows 1-20)
> updating as current time in VB6.
>
> Ex:  This function SHOULD do the following:
>
> First time around, row label 20 holds current time.
>
>  frmMain.chtLive.Row = 20
>  frmMain.chtLive.RowLabel = Format(Now(), "ss") 'seconds on the minute
>
> Second time the function in question is called, row 19 label takes value
> from row 20 label, and row 20 received new current time.
>
> Third time around row 18 label takes the value from row label 19, and row
> label 19 takes value from row 20 label, and row 20 label receives new 
> Current
> time.
>
> Note:  After row label 1 receives the old time from row label 2 and 
> displays
> it, it should then drop off and delete, making room for next 
> value.....like a
> realtime line graph.
>
>
> Does anybody know how to do this?  You don't have to even know about
> graphs...I think it's done with passing values between arrays but I can't
> seem to wrap my head around this to implement it. Any Ideas Anyone? Please
> help!! Thanks!
>
> Brad

I would keep a separate array to shift the values downward, then copy them 
to the RowLabel. This way you only have to select each row once. At start 
all RLabels will be empty "".


Something like (air code).

Dim RLabels(20) As String


Sub UpdateRowLabels()
Dim tempTime As String
Dim i As Long

tempTime = Format(Now(), "ss")

For i = 1 To 19
  RLabels(i) = RLabels(i+1)
  frmMain.chtLive.Row = i
  frmMain.chtLive.RowLabel = RLabels(i)
Next

RLabels(20) = tempTime
frmMain.chtLive.RowLabel = tempTime

End Sub

/Henning


0
Henning
3/31/2010 9:04:56 PM
Reply:

Similar Artilces:

Need help with CListCtrl
Using CListCtrl, but when I sort the indexes do not go along with the records. Here's what I mean: Suppose I add these items: Row 0: John Row 1: Bob Row 2: Tom Now when I click on the header and sort them in alphabetical order: Row 1: Bob Row 0: John Row 2: Tom Now when I call GetItemData(0) I am expecting to get "John". 0 is where I added "John". But instead, I get "Bob" (the new sort ordered index). So this presents a problem. I have no idea where John is anymore.. in case I wanted to edit that item later, I have to scan through all the items. You...

Printing Labels (Receipts) For Each Item On Work Order
I need to print labels containing Ship to Address, Item Look up Number and description. Each Item Needs an Individual Label With All of This Information and the Number of Labels Printed Should Reflect The Quantity From a Work Order. I am attempting to do this as a receipt. I am looking at code from existing receipts and trying to cut and paste what I need from diffrent receipts into one that may suite my needs. I am no XML pro to say the least. If anyone knows a better way or has more experience with XML and may wanna help I would appreciate it! ...

Tractor Fed label roll gets 3.3 inch feed at end of page? How do.
Once again I begin what seems like a simple project and reality hits me with a two by four on the back of the head. THE ISSUE: Continuous form, custom product and serial number label for our products that feeds a Page Break at the end of the page in letter size page. I’ve used the Label Wizard and I defined the label as continuous, yet after 6 labels that print perfectly, I get a feed of 3.375 inches. I’ve looked everywhere in Access and I cannot find a way to override this automatic feed. THE SOFTWARE: Access 2002 SP3 THE PRINTER: Okidata Microline ML591, Dot Matrix 24 Pin, Rear Tra...

Reporting in CRM help!!!!!!!
Hi guys, It would be great if anyone could help me with this one. In the Sales Pipline report instead of using estimatedvalue for my calculations I want to use another custom field. Does anyone know how this can be done and if so how. I don't want to change any of the functionality of the report just simple change the field that use. My custom field is also a Money field Thanks Will Assuming you are using v3.0, You need visual studio to modify reports. Reports are saved in SQL reporting Services. If you are using 1.2, you customize reports using crystal "Will" wrote: ...

Please help #3
What does it mean when your publication has a blue screen with a pink background? That is what happens when I open Publisher. I cannot tell what colors are what. It means yucky colour scheme. -- "If you don't know where you are going, any road will take you there!" mlyon1@hotmail.com wrote: > What does it mean when your publication has a blue screen > with a pink background? That is what happens when I open > Publisher. I cannot tell what colors are what. =========================== Maybe the info at the following link will help: http://www.mvps.org/the_nerd...

Help needed with Vlookup code
I have noticed other vlookup codes in excel and after looking at them have started to try and use them myself. 2 questions. 1) The codes i saw had a lot of $ signs in them. I dont use them when i use vlookup and it seems to work fine. Is there a reason $ signs are added? 2) I have a vlookup code "=VLOOKUP(A9,Database!A1:F8000,2,FALSE)" and so on for a few lines and when it finds a blank box it puts 0 in there to represent that. Is there a way i can have it so that instead of putting a zero in it just leaves the box blank? -- Help Needed -------------------------------------...

very interesting query- please help
Ost Ocity Dstate Dcity Carrier Price Rank Diff A B C D X 1200 1 100 A B C D Y 1300 2 100 A B C D Z 1350 3 100 A B C D W 1789 4 100 A1 B1 C1 D1 X1 785 1 A1 B1 C1 D1 Y1 789 2 The rank for every carrier is based on the price . If rank1 carrier is not a pariticular carrier(say if it is not X1 or Y1 or Z1), then i want to calculate the difference be...

Bar Code
I'm opening a new retail business and would like to use the Manufactures bar code on many of my items......but for the life of me I can't figure out how to load the information into my system. I've serched the HELP screens, but no answers. I'm desperate - Can anyone guide me on how to do this? Sincere, thanks to anyone who can help :) Monica If using the UPC as your ILC doesn't work, you can add the UPC codes to the Alias tab of the Item Properties. Then if you're searching for WIDGET you don't need to memorize the UPC codes. HTH, Tom "Monica" ...

moving a row between worksheets
I want to write VBA code that does the following: When a value in column E is changed to "John" that entire row is moved to a worksheet (in the same spreadsheet) called "Assigned". Is this possible? Thanks! Amit, I've uploaded the file with code to http://Galimi.com/Examples/MS.xls Following is the code to be embedded as a Change event on the sheet that recognizes the word John: Private Sub Worksheet_Change(ByVal Target As Range) If Target.Column = 5 Then If Target.Value = "John" Then 'Move the column to the Assigned sheet ...

please help....
been trying to find how i can get office microsoft publisher,word,excel,templates and i own a windows 98 SECOND EDITION machine...I know it is somewhere yet i dont know where to look to find it...Can you please assist me in where i may locate on how to find it?Would like to download this too my system...Did have a windows 98 at the office i use to work at and we had microsoft there so i do believe it is somewhere.. thank you...kittenjasmine KittenJasmine, The only way you have Office is if you paid for it. It has nothing to do with which version of Windows that is installed on your compu...

HELP!!! How do you create a query crieria for multi values??
Hello all, please hyelp, its an emergency!!! Need to create a query where one of the searches is male or female, how do I allow user to enter both as the search options?? Also how do I convert tix boxes into a query criteria (e.g. serach for all ticked) Thanks so much for your help ...

Dlookup HELP 02-01-08
I am trying to use a DLOOKUP in a report To lookup a value in a stored query from information that is the report. I have a report that gives me a customers parent account name and I am trying to then use that parent account name to look up a comment stored in another query. This is how my formula looks =DLookUp("TXTFIELD","Query","Query.ParentAccount"="ParentAccountFromReport") Any sugesstions? Perhaps something along the lines of =DLookUp("TXTFIELD","Query","ParentAccount=""" & ParentAccountFromReport &a...

Hooking cells with certain rows
Let me explain what I'm doing. I'm open to different suggestions to this. First I have Excel 2000 running on a 98b machine. The information I'm working with is statistics for an auto racing series, current year into a "career total group" What I'm doing is this. I had it set up like this for the former series I worked with, but I'm working on an entirely new batch of drivers now. I have 3 files. The current year's data, the total of all the years (the career stats) and a file that adds the two together. First, I cannot put all three together, e...

How Can I hide unused Rows in Spreadsheets
I have a financial forecasting system built in Excel which runs to 30 pages. It is designed for businesses and includes budget, cash flow and forecast balance sheets and is able to be updated monthly with actual results which then drive the projections for the rest of the year. So that it can be used by a wide range of businesses, it has a large number of rows on each sheet � for instance it has 16 rows for different sales types and has sufficient rows for over 110 overhead expenses. This is because the expenses are broken down into groups � eg Selling Expenses, Financial, Admin etc. The re...

Auto adjusting # rows between 2 worksheets
I have a spreadsheet where I import daily data into worksheet A. Sometimes there will be 5 rows of data and sometimes 1000+. Then inside the spreadsheet I have Worksheet B that runs some formulas based on Worksheet A. My question is how do I get Worksheet B to automatically extend or reduce the # of rows to match Worksheet A? Please help or give me some direction! thanks Kevin, You can have Spreadsheet B adjust the number of formula's programattically by cycling through the maximum used range in Spreadsheet A and inspecting individual cells for formula's. The followin...

Copy row to worksheet IF
I have a worksheet that I call data. I paste a set of data into this worksheet and I want certain rows(A:G) to be copied to another worksheet (Status) if Column B states Failed, Not Completed or No run. This is untested, so make a copy of your workbook to test with. But I think it'll work just fine for you. To put the code to work, open the copy of the workbook, press [Alt]+[F11] to open the VB Editor then choose Insert-->Module and copy and paste the code below into the module. Make any edits to the Const values that you see are needed. Close the VB Editor, run the ...

Copy an IF function when Inserting new row
I have a column with a list of IF functions in each one. I need to insert a row, but when I do the IF function is not copied. Can I insert the row and have the IF function automatically entered in the new row created? Hi see your other post -- Regards Frank Kabel Frankfurt, Germany "Philobr" <Philobr@discussions.microsoft.com> schrieb im Newsbeitrag news:D0757A3C-4A9F-4246-85BB-3CF67B0216B5@microsoft.com... > I have a column with a list of IF functions in each one. > I need to insert a row, but when I do the IF function is not copied. > Can I insert the row and hav...

sum tables cells using row and column conditions
Hi, i need to sum the values in a table based on a name match in COLUMN B and a text match in ROW 4 - say for each occurrence of "Jim Smith" in range B7:B505,when "text" appears in range E4:GC4, SUM all cells which will contain number values- so if:- text1 text2 text3 text1 Jim Smith 3 6 2 4 Sue Brown 1 5 1 7 Mark Bosman 2 9 3 6 Jim Smith 5 4 2 3 the result would have ...

combine two row in one
I have two lines of data Hello I mast combine 2 rows with a macro vba and create a third row with the data in increasing order, and delete the equal elements example row 1 E100001 E200120 E200124 E200127 E200152 Rows 2 E100001 E100101 E200120 E200124 E200127 E260250 Result in row 3 E100001 E100101 E200120 E200124 E200127 E200152 E260250 thanks John Here's a starting point. I assumed that the data is in one column and 2 rows and the result is in the row immediately after the last row you selected. Just select two rows and one column of data ...

Macro help: Adding Specified Blank Formatted Rows Automatically?
How do I make a macro that will prompt with a dialog box to copy the rows a certain number of times. For example, if I have 2 rows of data and I want to be able to specified any number of copies of the 2 rows blank without the data but maintain the formats (colors, condition, formulas, code, etc.). I want to add the rows to the existing worksheet. Also, I would want to this macro to be flexible to maintain it�s function if I add or delete columns from the chart. See sample chart File Attached: http://www.exceltip.com/forum/attachment.php?postid=279064 (question5 sample1.xls) ----------------...

I Need to divide all cells in rows 2 and 3 by 100
Merry Christmas, I need to divide all cells in rows 2 and 3 by 100. Anybody know a way to do this? put 100 in a cell, copy it, select row 2 and 3, do edit>paste special and check divide Regards, Peo Sjoblom "Brent E" wrote: > Merry Christmas, > > I need to divide all cells in rows 2 and 3 by 100. Anybody know a way to do > this? Put "=1/3" in a cell and then select it, copy, then select rows 2 and 3 and click edit | paste special | multiply. "Brent E" wrote: > Merry Christmas, > > I need to divide all cells in rows 2 and 3 b...

Error: "ran out of resources" running 5,000 row array
I'm using an array formula to calculate the Gini coefficient of columns of data. I'm getting the 'Excel ran out of resources' message on any array more than 5,000 or so rows, which seems very low to me. I'm using Excel 2007 and have 3 GB of RAM, so it's not clear where the problem is. Does anyone know of a fix for this? Either a way to free more resources, or to calculate Gini coefficients without using an array formula? Thanks! Only 2 of the GB are available for the User, the rest is for the system. So you may have to reduce your data set. agbiggs@hotmail.com wrot...

Data Labels #15
I need to align data values so that they appear outside the bar chart at the top of the chart. Excel only allows to choose the data value to appear inside the top of the bar chart. Please advise. Have a look at these add-ins (free) Rob Bovey's Chart Labeler, http://appspro.com John Walkenbach's Chart Tools, http://j-walk.com best wishes -- Bernard V Liengme Microsoft Excel MVP http://people.stfx.ca/bliengme remove caps from email "Mike Jacobs" <Mike Jacobs@discussions.microsoft.com> wrote in message news:39F619CB-1F50-42C8-9F5E-A25A02CA28C0@microsoft.com... ...

HELP: Email body deleted when I receive voting response
Hi All, I am sending emails in outlook through excel with voting buttons. But, whenever I vote using voting buttons in outlook, Email body gets deleted when the voting response email is sent. Is there any outlook property that I can use to keep the email body when the voting responses are sent? So for eg: If I have enabled voting buttons and asked to vote on something from person xyz, the person xyz votes "accept" or "reject" and the email body is deleted when I receive the vote response email. Is there a solution for this? I want the email body to stay w...

how to create mailing labels from excel data?
I need step by step instructions of how to create mailing labels from data in excel. I have tried using the online support directions and I can't get it to work. Thanks so much Hi Tyra my advice would be to use Word to create your mailing labels with Excel as the mail-merge data source. however, for this to work, the data is excel needs to go across columns so that one row is one piece of information for one recipient. for step by step instructions on how to perform the merge please reply with your word & excel versions. Cheers JulieD "Tyra" <Tyra@discussions.micr...