|
-
Aug 4th, 2003, 02:43 AM
#1
Thread Starter
Member
Show info about selected point in MSChart (PointSelected)
I want to be able to show a tooltip when the user clicks on a point on a MSChart.
But how do I get it to run my function when the user clicks on the dots?
I found this function and tried to create a new one but it won´t run it.
"Private Sub object_PointSelected ( series As Integer, dataPoint As Integer, mouseFlags As Integer, cancel As Integer )"
Thanks
-
Aug 4th, 2003, 05:17 AM
#2
Thread Starter
Member
I got so I can get the function to run, when a dot is marked but how can I see which dot is marked?
How can I get any indata to my function?
I´m using
Private Sub Graph_PointSelected(ByVal sender As Object, ByVal e As AxMSChart20Lib._DMSChartEvents_PointSelectedEvent) Handles Graph.PointSelected
End Sub
Thanks for help
Last edited by Iceman5; Aug 4th, 2003 at 06:15 AM.
//Martin Andersson
-
Aug 5th, 2003, 01:56 AM
#3
Thread Starter
Member
Have fixed it now so don´t bother.
Last edited by Iceman5; Aug 5th, 2003 at 08:17 AM.
//Martin Andersson
-
Nov 23rd, 2004, 10:41 AM
#4
Frenzied Member
Can you please share me your code...
I cannot find any info on how to fill a chart using MSCHART....
-
Nov 30th, 2004, 07:07 AM
#5
Thread Starter
Member
MSCHART
Hello Dino.
Well it was a while ago i created that program. But after looking in the code again I will try my best to explain how I did it with some code.
First you need to put an MSCHART on the form and do the settings on rows, columns and so on.
I can explain it more later if you don´t find it.
MSChart.RowLabel = "Label" 'Sets the label for each column
In my case I used a datagrid and plotted the info from it.
So here is my code for inserting in the MSChart
'5 different columns
For i = 1 To 5
'Checking if the datagrid value is 0
If Datagrid(k, i) <> 0 Then
'Specifies which row I want to insert the info in
MSChart.Row = i
'Specifies which column I want to insert the info in
MSChart.Column = j
'Inserting the data in the MSChart.
MSChart.Data = Datagrid(k, i) - 1
Else
MSChart.Row = i
MSChart.Column = j
MSChart.Data = 0
End If
Next
In this case I had 5 values in every column.
Hope this helps a little.
If there is anything else I can do for you just write here or to my mail.
There is alot more you can do with the MSChart. I got another program where I do some more settings. But I don´t remember it at the moment.
-
Nov 30th, 2004, 07:27 AM
#6
Frenzied Member
-
Nov 30th, 2004, 08:30 AM
#7
Frenzied Member
How did you manage to get the pointer selecter ?
so so confused with all these charts...
-
Dec 1st, 2004, 05:13 AM
#8
Thread Starter
Member
Erhm...
Have to check another program to refresh my memory.
And here is what I got.
It ain´t easy with the MSChart. Took me alot of time to plot and to get the info about the dots.
I found a Procedure (Sub) called PointSelected.
When you got the codewindow, just choose the name of the MSChart in the left dropdownlist and then choose the function "PointSelected" in the right dropdownlist.
You can find alot of functions there in the dropdown lists.
Here is my Sub.
Code:
Private Sub Graph_PointSelected(ByVal sender As Object, ByVal e As AxMSChart20Lib._DMSChartEvents_PointSelectedEvent) Handles Graph.PointSelected
'i,j = Counter
Dim i, j As Integer
'Gets the row in the datagrid that selected point got
i = e.dataPoint
'Gets the serie selected point got
j = e.series
'Puts info to the Labels from my datagrid
L_Info_One.Text = DG_Repair_Data(database_row(i), 0)
L_Info_Two.Text = DG_Repair_Data(database_row(i), 1)
L_Info_Three.Text = DG_Repair_Data(database_row(i), 3)
L_Info_Four.Text = DG_Repair_Data(database_row(i), 5)
End Sub
database_row is declared as an integer
Is it working for you?
-
Aug 23rd, 2006, 09:39 AM
#9
New Member
Re: Show info about selected point in MSChart (PointSelected)
 Originally Posted by Iceman5
I want to be able to show a tooltip when the user clicks on a point on a MSChart.
But how do I get it to run my function when the user clicks on the dots?
I found this function and tried to create a new one but it won´t run it.
"Private Sub object_PointSelected ( series As Integer, dataPoint As Integer, mouseFlags As Integer, cancel As Integer )"
Thanks
In VB6 works this:
Private Sub MSChart1_PointSelected(Series As Integer, _
DataPoint As Integer, MouseFlags As Integer, Cancel As Integer)
MSChart1.Row = DataPoint
MSChart1.ToolTipText = MSChart1.Data
End Sub
Good luck
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|