473,811 Members | 1,881 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Using MSChart



Hello, I'm trying to plot some data on a 2d line chart using MSChart.
The code below worked fine on a 2d bar chart, but nothing appeared when
using the 2dline chart property. Should I use the DataGrid at all, or
can you bind the chart to a multi-dimension array and still have the
chart updating? I have my readings in an ArrayList collection but never
managed to bind it to the data grid, so I just decided to send the
readings one by one instead.

Cheers.
Originally I had this:

Private Sub Draw_Chart(ByVa l Reading)

Dim myObjArray() As Object = {Reading}

ReadingDataGrid .SetDataBinding (myObjArray, "")
ReadingChart.Ch artData = myObjArray
'Add a title and legend.
With Me.ReadingChart
.Title.Text = "Reading"
.Legend.Locatio n.LocationType = _
MSChart20Lib.Vt ChLocationType. VtChLocationTyp eBottom
.Legend.Locatio n.Visible = True
End With

'Add titles to the axes.
With Me.ReadingChart .Plot
.Axis(MSChart20 Lib.VtChAxisId. VtChAxisIdX).Ax isTitle.Text =
"Year"
.Axis(MSChart20 Lib.VtChAxisId. VtChAxisIdY).Ax isTitle.Text =
"Millions of $"
End With

'Set custom colors for the bars.
With Me.ReadingChart .Plot
'Yellow for Company A
'-1 selects all the datapoints.
.SeriesCollecti on(1).DataPoint s(-1).Brush.FillCo lor.Set(250,
250, 0)
'Purple for Company B
.SeriesCollecti on(2).DataPoint s(-1).Brush.FillCo lor.Set(200,
50, 200)
End With
End Sub


--
Jeffrey Spoon

Nov 21 '05 #1
0 2408

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1566
by: gu | last post by:
I have a rather stupid problem with the mschart 6 component. It always sips one row in the source it's surposed to display. For example, if a SQL statement that defines the recordset object returns three records whose values should be displayed as a column type graph, mschart displays only two columns, which represent the two last records, always skipping the first row in a recordset. I know it's kind of stupid, but do you know what might...
0
1939
by: Gerhard Swart | last post by:
Good Morning, I have a licensed .Net product. Meaning I can develop and deploy my projects. I want to use MSChart in my latest project. Now I am not sure about the licensing of MSChart. As far as I know the MSChart ocx gets installed with VB.Net. If I want to deploy my project can I also deploy the MSChart ocx with my project without worrying about licensing for the MSChart ocx.
1
508
by: Jaime Lucci | last post by:
Has anybody any documentation about MSChart? Thanks.
1
3432
by: perspolis | last post by:
Hi all I want to print content of a MsChart.. I think I can do that by getting an image from that.. How can I do that?or is there any better way to print MsChart? thanks in advance
2
2022
by: John Blair | last post by:
Hi, In my webform HTML i have the following code, but i cannot view and configure this chart control in the code behind class. In the code behind class i have a reference to this com control but when i try and add it as a child control of say a panel control then it gives me a cast error. Is it possible to display and configure a chart in a web form?
2
3392
by: andrew | last post by:
I have an application that requires graphical output. I have added a MSChart to the application and want to be able to print this out. I have a form which allows me to print, and zoom in etc for images loaded into its picture box space and so I thought it would be a matter of copying the graph object to the clipboard and then casting its Metafile format to a bitmap which I could then use to fill the picturebox. Not so, although during...
0
1567
by: JS | last post by:
Hello I want translate a project from VB6 to VB.Net 1.0 In this project I have a graph with a MsChart COM control. When I want make reference (Projet/Ref /Com controle) to this chart I have an error message " Tlbimp.exe not found. Reinstall VB.net". So Tlbimp is in my folder "D:\Program Files\Microsoft Visual Studio ..NET\FrameworkSDK\Bin" 1-How VB.net cant found the path for Tlbimp ? 2 Else maybe I must execute manually the wrapper...
0
51240
debasisdas
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...
2
1097
by: Just_a_fan | last post by:
I was working with MSChart, modifying one of the graphs and decided I wanted this particular chart to have an auto scale. I worked quite a while with it, uttered a few obscenities directed at the usual suspects and finally found I have to do an Application.DoEvents to get it to honor the numbers is it telling it knows but ignores (charts the old scale) until the next update. Of course, by the next update, the message queue has been...
0
2644
by: Just_a_fan | last post by:
Some folks have searched, from time to time, for a dual axis MSChart with different scales on the two Y axes. The sample, extracted from running code I wrote, produces a graph with MSChart (VB9) which shows a time axis on X and two somewhat different value ranges on Y and Y2. This code produces two axes with positive and negative values, if called for, and also ranges the Y and Y2 values to match the data and still remain readable. ...
0
9728
marktang
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...
0
10389
jinu1996
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...
1
10402
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,...
0
9205
agi2029
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...
0
6890
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();...
0
5554
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5692
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3867
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3018
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.