Real-time graph using Mschart - Page 2


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Page 2 of 2 FirstFirst 12
Results 16 to 20 of 20

Thread: Real-time graph using Mschart

  1. #16
    Join Date
    Nov 2003
    Location
    Alameda, CA
    Posts
    1,737
    Hi Marek,
    because you said that you were using the code I used, and I was redim-ing every time. This my code changed to redim only once. I add a chart and I left all defaults, plus a timer setting the interval to 1000msec.
    The lines you see in the chart at design mode are just there to show how the chart looks as properties are changed.
    The Scale property changes ScaleLeft, ScaleTop, ScaleWidth and ScaleHeight in just one call.
    Marco
    Code:
    Option Explicit
    
    Dim myarray(109) As Double
    Dim lastEntry As Long
    
    Private Sub Timer1_Timer()
        Timer1.Enabled = False
        Dim k As Long
        For k = 0 To 9
           myarray(lastEntry + k) = Rnd * 50
        Next
        chart.chartData = myarray
        chart.Refresh
        lastEntry = lastEntry + 10
        Timer1.Enabled = (lastEntry < 110)
    End Sub
    "There are two ways to write error-free programs. Only the third one works."
    Unknown

  2. #17
    Join Date
    May 2005
    Location
    St. John's
    Posts
    3
    Thanks again for Your reply Marco. I came to a conclusion that MSChart is not the way to go about what I want to achive and your earlier suggestions about scaling were also very helpful. I am sure that MSChart will flicker every time I refresh it (btw the line "chart.Refresh" is not needed in the last bit of code you posted, "chart.chartData = myarray" does it. I tried it with the "chart.Refresh" line commented out). It is designed to load all the data into datagrid and then refresh screen (flicker) adjusting scales beforehand. But it will try to decide if scale adjustments needs to be made every time before ploting the data.
    Please correct me if I am wrong.
    Another interesting point I do not understand regarding You code is why it does not work for any other chartType but 2dBar? At least I did not have much succes changing chartType property and running it.

    Thanks again. I feel I will have my first VB program done by monday. But it is a part of slightly larger project so coding does not stop there.
    Marek

  3. #18
    Join Date
    Aug 2007
    Posts
    4

    Thumbs up MsChart update and documentation

    Hi,

    You can download the updated MsChart 6.0.1 control with documentation from here.

    www.reportingengines.com /download/spreadsheet/FISetup.exe

    Major bug Fixes:
    - datapoint(-1) error, can now do datapoint(n)
    - rendering time
    - array copy offset fix

    No source code changes required [simply replace mschart with updated component and give same name] and IT COMES WITH DOCUMENTATION !!


    Found it when I had problems with charting, see: support.microsoft.com

    Microsoft kb 178545:
    The Microsoft Chart control is based on First Impressions by Visual Components....First Impressions is manufactured by Visual Components, a vendor independent of Microsoft


    David

  4. #19
    Join Date
    Aug 2007
    Posts
    4

    Smile MsChart flicker

    Use VTChart1.DrawMode = VtChDrawModeBlit

    VtChDrawModeBlit 1 The chart is redrawn off screen and displayed after the redraw is complete.

    VtChDrawModeDraw 0 The chart is redrawn on the screen every time you change a setting.
    Blit mode stores a bitmap copy of the chart in memory when the chart is laid out. Repainting the chart uses the bitmap and draws very quickly. It requires more memory than Draw mode, but can save time waiting for the chart to redraw on screen. Blit mode is particularly useful when working with charts that contain many elements.

  5. #20
    Join Date
    Sep 2007
    Posts
    1

    Sabir

    Hi, This post is very informative, however I would like some specific information. If someone can help me then please send me a private message. Best Regards,

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center