Results 1 to 9 of 9

Thread: Show info about selected point in MSChart (PointSelected)

  1. #1

    Thread Starter
    Member
    Join Date
    Jul 2003
    Location
    Sweden
    Posts
    62

    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
    //Martin Andersson

  2. #2

    Thread Starter
    Member
    Join Date
    Jul 2003
    Location
    Sweden
    Posts
    62
    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

  3. #3

    Thread Starter
    Member
    Join Date
    Jul 2003
    Location
    Sweden
    Posts
    62
    Have fixed it now so don´t bother.
    Last edited by Iceman5; Aug 5th, 2003 at 08:17 AM.
    //Martin Andersson

  4. #4
    Frenzied Member dinosaur_uk's Avatar
    Join Date
    Sep 2004
    Location
    Jurassic Park
    Posts
    1,098
    Can you please share me your code...

    I cannot find any info on how to fill a chart using MSCHART....

  5. #5

    Thread Starter
    Member
    Join Date
    Jul 2003
    Location
    Sweden
    Posts
    62

    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.
    //Martin Andersson

  6. #6
    Frenzied Member dinosaur_uk's Avatar
    Join Date
    Sep 2004
    Location
    Jurassic Park
    Posts
    1,098
    CHeers !!!

  7. #7
    Frenzied Member dinosaur_uk's Avatar
    Join Date
    Sep 2004
    Location
    Jurassic Park
    Posts
    1,098
    How did you manage to get the pointer selecter ?

    so so confused with all these charts...

  8. #8

    Thread Starter
    Member
    Join Date
    Jul 2003
    Location
    Sweden
    Posts
    62
    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?
    //Martin Andersson

  9. #9
    New Member
    Join Date
    Aug 2006
    Posts
    1

    Re: Show info about selected point in MSChart (PointSelected)

    Quote 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
  •  



Click Here to Expand Forum to Full Width