[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 277
  • Last Modified:

help me to make a dynamic graph in picture box in a particular trend

help me to make a dynamic graph in picture box in a particular trend
i.e the graph should be running in a picture box like a sine wave
graph should start from left side of the picture box
0
rkpune
Asked:
rkpune
  • 6
  • 4
1 Solution
 
fds_fatboyCommented:
Do you mean a constantly moving graph similar to the Perfomance CPU history in the Windows Task Mangler?
0
 
rkpuneAuthor Commented:
Yes, I want a constantly moving graph in picture box. Yes it should be like CPU History in Win Task manager. But I want it to be moving from left to right.
Thanks in anticipation
0
 
Shiju SasidharanCommented:
well, u have dynamic y- values -
what type of graph u need , curve or line ?
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
rkpuneAuthor Commented:
I want both types of graphs.
0
 
rkpuneAuthor Commented:
there is no answer till now
pls forward it asap
thanks
0
 
fds_fatboyCommented:
Or to move from left to right, use the above and change the timer event handler like so:


      Private Sub Timer1_Timer()
          Dim i As Integer
          Call BitBlt(hDCh, _
                        0, _
                        0, _
                        pWidth - 1, _
                        pHeight, _
                        hDCh, _
                        -1, _
                        0, _
                        SRCCOPY)

          If counter Mod pGrid = 0 Then
              Call MoveToEx(hDCh, 1, 0, 0)
              Call LineTo(hDCh, 1, pHeight)
          End If

          i = Sin(0.1 * counter) * _
               (pHeightHalf - 1) + _
               pHeightHalf

          Call SelectObject(hDCh, hPenC)
          Call MoveToEx(hDCh, 2, oldY, 0)
          Call LineTo(hDCh, 1, i)
          Call SelectObject(hDCh, hPenB)
          Call BitBlt(Picture1.hdc, _
                        0, _
                        0, _
                        pWidth, _
                        pHeight, _
                        hDCh, _
                        0, _
                        0, _
                        SRCCOPY)
          counter = counter + 1
          oldY = i
      End Sub
0
 
rkpuneAuthor Commented:
how to increase the width of the distance betbeen the graphs?
that is i want to make an irreregular graph
a graph like an ecg graph
0
 
fds_fatboyCommented:
Just change the

 i = Sin(0.1 * counter) * _
               (pHeightHalf - 1) + _
               pHeightHalf

to whatever you want it to be.

If you want to do an ecg looking thing then you'll need an array of values to set i to. Every timer event, set the value of i to the next value in your array. Every time you get to the end of the values, set i back to the first one.

I have no idea what should be in the array, I'm not a computer programmer, not a doctor.
0
 
fds_fatboyCommented:
>>I'm not a computer programmer, not a doctor

ha ha - did I really write that. Some people might say that its true. I should have said

"I'm a computer programmer, not a doctor."
0
 
fds_fatboyCommented:
Hello

Do you require anything else?
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 6
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now