I have a table (MSFlexgrid1) in a form (frmCalculate) containing 2 columns of Depth and Volume data. I want to draw a line graph of Depth Vs Volume in a new form (frmGraph) by using MSChart control. How can I do this?
10 14716
Is it: X= depth Y= volume ?
Y| volume
|
|
|
|_________X depth
or vice versa ?
While I search on web about this matter, I found about drawing graph using FusionChart. I have downloaded it an read through its documentation, but I couldn't find on drawing graph by using data from MSFlexgrid. What is exactly the different of drawing the graph by using FusionChart and MSChart controls? Which one is easier to understand and use?
TQ for your help :)
Fusion chart is an application to embed in other applications like java, ... Works with PHP, ASP.NET, JSP, ColdFusion, Python, RoR, simple HTML pages or even PowerPoint Presentations
All the charts can pull data from any database and are AJAX enabled
I think that MSchart is better for Your project because:
- It's standard VB6 and easy to implement in Your program because You only want to show a line and not fancy 3D graphs.
- If You use Fusionchart them the software has to be installed on each computer who wants to run Your program.
Ps: I'm testing MS chart have already results but have to learn how to use it to set titles, axis, ...
How it's work: its very simple: put the data in an array and link the chart with the array.
Attached is what I have for now. (!!! the X axis IS NOT OK !!!!: volume is in the graph to !!!)
I have only to find out how the array must be populated and the graph parameters must be set for an XY graph.
Thank You for the code :)
However there are several things I want to change on the graph. I went through your code but somehow I am not quite clear on how this MSChart works. How did you declare the grid columns to the graph axes respectively? Which line in the code is for this purpose? These are the things on the graph I wish to change:
- There are 2 lines appear on the graph (red and green). The red line represents depth - storage graph. What is the green line represents? How to get rid of it?
- The Volume values in X axis represented by R1, R2, R3,... How to change them to decimal numbers?
- The first point on the graph is (0,0), but somehow it does not lie on the intersection of the X and Y axes, which means the 0 value of X is not in the same point as 0 value of Y. Is it possible to change that?
TQ for your time...
You have to define the settings for the chart: (see also attachment) - Private Sub Form_Load()
-
With ChartCalc
-
.chartType = VtChChartType2dXY
-
.Plot.UniformAxis = False
-
With .Plot.Axis(VtChAxisIdX)
-
.AxisTitle.Text = "Volume"
-
.ValueScale.Auto = True '§ Turn on the auto scale
-
.ValueScale.Maximum = ARRAYGRAPH(UBound(ARRAYGRAPH), 1) '§ set the max and min.
-
.ValueScale.Minimum = ARRAYGRAPH(LBound(ARRAYGRAPH), 1)
-
End With
-
With .Plot.Axis(VtChAxisIdY)
-
.AxisTitle.Text = "Depth"
-
.AxisTitle.TextLayout.VertAlignment = VtVerticalAlignmentCenter
-
.AxisTitle.TextLayout.Orientation = VtOrientationUp
-
.ValueScale.Auto = True
-
.ValueScale.Maximum = ARRAYGRAPH(UBound(ARRAYGRAPH), 2)
-
.ValueScale.Minimum = ARRAYGRAPH(LBound(ARRAYGRAPH), 2)
-
End With
-
.ChartData = ARRAYGRAPH
-
End With
-
End Sub
THANK YOU!!! That works so well! Now I know how to use MSChart control. Thanks to YOU! :)
Opps... There's one more thing. If the depth start with negative numbers, e.g., -5.000, the X axis values will appear on the middle of the chart grid (see attachment). can we make it be at the bottom of the grid no matter what value of the first depth is?
Just add in the code the settings for ".intersect ion" => - With .Plot.Axis(VtChAxisIdX)
-
.AxisTitle.Text = "Volume"
-
.ValueScale.Auto = True '§ Turn on the auto scale
-
.ValueScale.Maximum = ARRAYGRAPH(UBound(ARRAYGRAPH), 1) '§ set the max and min.
-
.ValueScale.Minimum = ARRAYGRAPH(LBound(ARRAYGRAPH), 1)
-
.Intersection.Auto = False
-
.Intersection.LabelsInsidePlot = False
-
End With
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: RichMo |
last post by:
Hi,
I'm new to C++ and i can't seem to find a tutorial on the net for this
one.
I have a dialog based MFC app running that reads sensors using a USB
interface device.
At the moment the varying data just moves a progress bar up and down.
I'm looking for a way to display this sensor data as a graph on the
|
by: mike11d11 |
last post by:
I tried using the windows winsocket control on my Access form and place
the recieved data in a text box. I got it to work but the data is
coming accross like ÿþ%ÿý and I cant use that information. Is
there a way to descramble this. I'm thinking it might have to do with
using some sort of emulation that can read the info. We have software
right now that connects to our server with VT101 emulation. If this is
what is making it readable...
|
by: debasisdas |
last post by:
Hi i am using MSCHART control in VB6 to create some interactive chart.
It works fine ,but my problem is every time i frame the query dynamically as per user interaction it skips the first record from the recordset.
I am using Oracle 9i as my database.
anyone can help me please.........
|
by: j2flk1234 |
last post by:
Hi,
I have a user entering information into a MSFlexGrid and want to graph some of the data using a line graph. I tried using MSChart but it doesn't seem to work for me. Does anyone have any other suggestions?
Thanks in advance.
|
by: debasisdas |
last post by:
Here's a simple VB6 code snippet that uses the MSChart control to display Charts in VB6.0.
To use this sample, please following steps
Create a new project in VB6
Pull down the Project menu and choose Components .
Select the checkbox next to Microsoft ChartControl 6.0(OLEDB), Click OK.
Add a combobox,one Mschart control and one check box tothe existing form.
Paste in the following code tothe code window
Private Sub Form_Load()
'Fill the...
| |
by: shweta goel |
last post by:
Anyone can tell me : how to draw pie chart using MSChart control having data from 2 or 3 variables.
|
by: mani.shanku |
last post by:
hi friendsplz..help me its urgent.....
im making a jobportal site..when a person go for search the results
should desplay....
like the naukri.com desplays..and when a person click on the checkbox
box link...
it is navigating to another window..
......my problem is .i added a checkbox control to gridview but i can't
able to make navigation when he clicks on that checkbox
plz..help me...
|
by: buddyr |
last post by:
Hello,
I have form in C#.
I want to use the errorprovider control to prompt user for data if nothing is entered.
example:
I have textbox1 for user to enter name.
I have radiobuttons for job departments.
I click a button and data displays in labels.
label1.text = textbox1;
if (radiobutton1.clicked)
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
| |
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |