Re: Zoom or expand a chart



Dave,

Would you consider replacing the pictureboxes with other
components?

You may want to look first at controls specifically designed for
charting.
If you have a chart type which is not supported by charting controls
or if charting controls don't support the type of chart you want, then
you might consider an image creation control like MetaDraw.
Our MetaDraw control replaces picturebox and you can create
your chart in very similar fashion but with advantages of
- scrolling
- zooming
- hide / show diferent lines within chart
- allow users to select lines
( useful to show user additional information for
specific data segments )
- dynamically change colors, line thicknesses, etc
- save to variety of file formats
- high resolution printing.
- more

* * Please include a copy of this message with your reply

Jeff Bennett
Jeff@xxxxxxxxxxxxxx

* Bennet-Tec Information Systems, Inc
* 50 Jericho Tpk, Jericho, NY 11753
* Phone 516 997 5596, Fax - 5597
* RELIABLE Components Make You Look Sharp!
* TList/Pro * ALLText HT/Pro * MetaDraw *
* Custom Software Development Services Too.
* WWW.Bennet-Tec.Com

=================== ===================

From: DaveO - view profile
Date: Tues, Mar 28 2006 9:41 am
Email: "DaveO" <jsinv...@xxxxxxxxxx>
Groups: microsoft.public.vb.general.discussion

Hi All

Using VB5 sp3 on WinXP Pro


My app has up to 10 charts / graphs on the form as follows :


Vertical scale = 1 to 100
each Horizontal scale has 6000 points


The data is read into arrays ( from a text file or database. )


Currently, I have a picture box inside a second picture box. I then use
the
picture2.line (x1, y1) - (x2, y2) method to draw the 6000 points on the

chart in picture2. I can then move picture2 inside picture1 to 'show' a

different part of the chart.


However, I need to be able to :
1. display different numbers of points ( eg. only the last 500 points,
or
only the last 1000 points of the graph ) - until now done by redrawing
the
entire chart.
2. when viewing the above segment, to be able to scroll the rest of
the
graph - can't be done with the current system - needs the chart (
picture2 )
to be wider than the container picture1.
3. also to zoom with a scroll bar.


I have set up 2 scroll bars. The first scroll bar changes the 'left'
position of picture2 ( inside picture1 ) so that the graph can scroll
horizontally.
But this does not allow for zooming, unless I change the .width of
picture2
and redraw all 6000 points.


The second scroll bar should be used to display the number of visible
points
( eg. picture2.width = picture1.width * ( 6000 / visiblePoints ) )


I have tried the following :
Draw the 6000 points into a hidden picture box.
Use stretchblt to 'copy' the hidden pic into the visible picture2. If I

change the size of picture2, I just re-stretchblt the hidden pic to the
new
resized pic.


Problem is : if I make the hidden pic the width of my form, then when I
zoom
into a smaller graph ( eg. the last 500 points ) the stretchblt
produces a
'chart' with lines as thick as a 2 x 4 plank. If I make the hidden pic
a lot
wider ( so a 500 point view is fine, & a 6000 point view is even finer
), it
bombs out from a lack of memory.


Obviously I am probably on the wrong track so need a bit of latteral
thinking here. Any suggestions ?


I need the solution to work on Win98+ systems.


Regards
Dave

.



Relevant Pages

  • Zoom or expand a chart
    ... Vertical scale = 1 to 100 ... I have a picture box inside a second picture box. ... different part of the chart. ... The first scroll bar changes the 'left' ...
    (microsoft.public.vb.general.discussion)
  • Re: Chart Rotation
    ... Jon Peltier, Microsoft Excel MVP ... If I drop the picture into work I can rotate it left 90 degees. ... pasted the copied chart into Word as a picture, ...
    (microsoft.public.excel.charting)
  • Re: Place wingding on specific coordinates - possible?
    ... I don't see any reason why you can't put your picture into a chart (don't ... Sub SetChart() ... Dim cht As Chart ...
    (microsoft.public.excel.programming)
  • Re: Place wingding on specific coordinates - possible?
    ... You can easily do without mouseclicks and class modules. ... ' If Not cht Is Nothing Then ... Made a new chart, ensured a picture is embedded in the chart (if you grab ...
    (microsoft.public.excel.programming)
  • Re: Adding pictures to data points
    ... That gave me a bar chart. ... Then I clicked in cell B1 and inserted the club character, ... When you use Edit> Copy Picture you will pick up all the white around the symbol. ... MVP infohttp://mvp.support.microsoft.com/ ...
    (microsoft.public.mac.office.excel)

Loading