Results 1 to 8 of 8

Thread: Is it possible to hide plotting data point marker on mschart ??

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2006
    Posts
    584

    Is it possible to hide plotting data point marker on mschart ??

    hi,please help,Is it possible to hide plotting data point on mschart ,if the data point is below the minimum scale Y from the mschart than the plotting data point marker will hide,if the data point is in the Y scare then the data point marker will show.

    for example:
    scale Y minimum = 25
    data plotting point = -1
    if the data plotting point is -1 and the scale Y minimum =25,if this situation data marker point will hide.


    please help.thanks.

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Is it possible to hide plotting data point marker on mschart ??

    Rather then try to hide it, just don't plot it if it is below a preset minimum.

  3. #3
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: Is it possible to hide plotting data point marker on mschart ??

    Why would you want to hide a point? I see no point in plotting a point if you dont want/need it.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  4. #4

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2006
    Posts
    584

    Re: Is it possible to hide plotting data point marker on mschart ??

    hack:
    hi,thanks ya reply.as you mention don't present the plot if it is below a preset minimum.

    for example:
    rss!seven<rs1!LCL

    rss!seven is the data plot.
    rs1!LCL is minimum scale.

    how to code it not plot if it below a present minimum.
    thanks for help.

  5. #5

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2006
    Posts
    584

    Re: Is it possible to hide plotting data point marker on mschart ??

    hack,
    i try to use this method.but cannot get the result.

    i try this method:
    Code:
    If Rss!seven < Text1.Text Then
                    ArrayChart(X, 5) = vbNull
                Else
                    ArrayChart(X, 5) = Rss!seven
                End If
    this is the current plot data point
    Code:
    Con.Open "driver={SQL Server};Server=ERP_server;Uid=sa;pwd=sa;database=SPC"
    
    Set Rss = Nothing
    Rss.Open " Select sum(sampleno/5)as subgroup,avg(data)as avgdata ,avg(sevenpoint)as seven, time,date from spcdata where date between '" & Format$(startdate, "yyyy-mm-dd") & "' and '" & Format$(enddate, "yyyy-mm-dd") & "' and partno ='" & partno & "'and dimension = '" & dimension & "' and machineno ='" & machineno & "'group by date,time", Con, adOpenKeyset ' Making Recordset
    rs1.Open "SELECT PartNo, Dimension,Nominal, UCL, LCL From PartList WHERE PartNo = '" & partno & "' AND Dimension = '" & dimension & "' ", Con, adOpenKeyset ' Making Recordset
     
         If Rss.RecordCount = 0 Then ' If no Record in Database, then Show an Error Msg and Exit the Sub
        Else
            ReDim ArrayChart(1 To Rss.RecordCount, 1 To 5) ' Array
            For X = 1 To Rss.RecordCount
            ArrayChart(X, 1) = Rss!avgdata
            ArrayChart(X, 2) = rs1!ucl
            ArrayChart(X, 3) = rs1!lcl
            ArrayChart(X, 4) = (rs1!lcl + rs1!ucl) / 2
            ArrayChart(X, 5) = Rss!seven
                     Rss.MoveNext
            Next X
      
        ' 'Set manually the setting of the Scale of Axis
    MSChart1.Plot.Axis(VtChAxisIdY).ValueScale.Auto = False
    MSChart1.Plot.Axis(VtChAxisIdY).ValueScale.Maximum = (rs1!ucl) + (0.2 * ((rs1!ucl) - (rs1!lcl)))
    MSChart1.Plot.Axis(VtChAxisIdY).ValueScale.Minimum = (rs1!lcl) - (0.2 * ((rs1!ucl) - (rs1!lcl)))
    text1.text = MSChart1.Plot.Axis(VtChAxisIdY).ValueScale.Minimum
            
    '# Assigns array to the MSChart control #
        MSChart1.ChartData = ArrayChart
        MSChart1.SeriesType = VtChSeriesType2dLine
        MSChart1.Refresh
        End If
        
          
        
        
        With MSChart1.Plot.SeriesCollection(1)
            .SeriesMarker.Auto = False
            .DataPoints.Item(-1).Marker.Visible = True
            .DataPoints.Item(-1).Marker.Size = 65
            .DataPoints.Item(-1).Marker.Style = VtMarkerStyleSquare
            End With
            
           With MSChart1.Plot.SeriesCollection(5)
            .SeriesMarker.Auto = False
            .DataPoints.Item(-1).Marker.Visible = True
            .DataPoints.Item(-1).Marker.Size = 65
            .DataPoints.Item(-1).Marker.Style = VtMarkerStyleSquare
            End With
                
     Set Rss = Nothing
     Set rs1 = Nothing
            
    End Sub
    Last edited by gracehskuo; Jun 18th, 2008 at 01:24 AM.

  6. #6

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2006
    Posts
    584

    Re: Is it possible to hide plotting data point marker on mschart ??

    hack,
    hi, i create another sql query to data not to plot below the present minimum.but than i face another problem.when i try to plot the unwanted data point it become a line chart.rs2!seven is the sql query not to plot below the present minimum.

    this is the current code:
    Code:
    Rss.Open " Select sum(sampleno/5)as subgroup,avg(data)as avgdata , time,date from spcdata where date between '" & Format$(startdate, "yyyy-mm-dd") & "' and '" & Format$(enddate, "yyyy-mm-dd") & "' and partno ='" & partno & "'and dimension = '" & dimension & "' and machineno ='" & machineno & "' group by date,time", Con, adOpenKeyset ' Making Recordset 
    rs1.Open "SELECT PartNo, Dimension,Nominal, UCL, LCL From PartList WHERE PartNo = '" & partno & "' AND Dimension = '" & dimension & "' ", Con, adOpenKeyset ' Making Recordse 
    rs2.Open " Select sum(sampleno/5)as subgroup,avg(data)as avgdata ,avg(sevenpoint)as seven, time,date from spcdata where date between '" & Format$(startdate, "yyyy-mm-dd") & "' and '" & Format$(enddate, "yyyy-mm-dd") & "' and partno ='" & partno & "'and dimension = '" & dimension & "' and machineno ='" & machineno & "'and sevenpoint <>-99999 group by date,time", Con, adOpenKeyset ' Making Recordset 
    
    
        If Rss.RecordCount = 0 Then ' If no Record in Database, then Show an Error Msg and Exit the Sub 
    '        MsgBox "No Data to Show on Chart!!!", vbCritical, "MSChart Demo": Exit Sub 
        Else 
            ReDim ArrayChart(1 To Rss.RecordCount, 1 To 5) ' Array 
            'Puuting Records from Database to Array 
            For X = 1 To Rss.RecordCount 
            ArrayChart(X, 1) = Rss!avgdata 
            ArrayChart(X, 2) = rs1!ucl 
            ArrayChart(X, 3) = rs1!lcl 
            ArrayChart(X, 4) = (rs1!lcl + rs1!ucl) / 2 
            ArrayChart(X, 5) = rs2!seven 
                    Rss.MoveNext 
            Next X
    please help.thanks.
    Attached Images Attached Images  

  7. #7
    New Member
    Join Date
    Jul 2008
    Posts
    1

    Re: Is it possible to hide plotting data point marker on mschart ??


  8. #8
    New Member
    Join Date
    Mar 2009
    Posts
    11

    Re: Is it possible to hide plotting data point marker on mschart ??

    Quote Originally Posted by RobDog888 View Post
    Why would you want to hide a point? I see no point in plotting a point if you dont want/need it.
    I see no point in replying to a question with a "why would you ask this question?" type of answer

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