Quinn-Curtis Forums
Quinn-Curtis Forums
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Tools for Microsoft .Net
 SPC Control Chart Tools for .Net
 zoom
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

maxonlibero

4 Posts

Posted - 14 Dec 2008 :  15:29:54  Show Profile  Reply with Quote
Hello,
I'm using in VB2005 an Individual Range chart with time axis.
Since my data sometime are rarefy and sometimes are very close I need a quick way to perform a zoom of a particular time range.
Is there a simple way?
or at least a way that clicking on the chart I can get the date time of the click.
Thanks
Max

quinncurtis

1586 Posts

Posted - 14 Dec 2008 :  17:56:59  Show Profile  Reply with Quote
We don't understand why you would need to zoom one of our variable control charts. While zooming is part of our general purpose charting library QCChart2D, this capability was not extended to the interface of the SPC software. Are you not using the tables, and plotting many more data points than our example progams ? How many?

A data tooltip for the charts is on by default. If you click on a data point you should see the time stamp for the data point and the data value. See our Individual Range example programs. Are you saying this is not working for you ?

If your data is not equally spaced with respect to time, you should be using the SPCBatchVariableControlChart, not the SPCTimeVariableControlChart. That way adjacent samples far apart in time will still be close to one another when charted. Are you clear as to the difference between the two?
Go to Top of Page

maxonlibero

4 Posts

Posted - 27 Dec 2008 :  17:54:53  Show Profile  Reply with Quote
First of all thank you for your reply.
In my case I have to display some laboratory tests within a particular time window (ex: from 6 April to 14 July).
I can have hundreds of tests not equally spaced (ex: some days the lab. is closed or for some reason in a particular day the guys do only few tests).
I know that should be used a SPCBatchVariableControlChart (and I'm giving also this option adding as much possible information in the data tooltip) but to be able to visualize within a day when a test has been done would be appreciated, infact the same test made in the morning could be give different result if done in the afternoon.
So the customer request was to be able starting from a range of days going in details using zoom.
Finally answering to your questions: I'm not using the table, usually I have 200 - 300 data points and I have clear the difference between SPCBatchVariableControlChart and SPCTimeVariableControlChart.
Thank you for your support.
Max
Go to Top of Page

quinncurtis

1586 Posts

Posted - 29 Dec 2008 :  10:37:51  Show Profile  Reply with Quote
While we did not design the SPC Chart routines with zooming in mind, you can implement zooming, using ChartZoom routines described in the QCChart2D manual.

Read the chapter on zooming in the QCChart2D manual, and run and study the ZoomExamples example program in the QCChart2D examples.

You can add a zoom with stack class to your main TimeVariableControlChart derived class:

c#

public class SPCApplicationUserControl1 : com.quinncurtis.spcchartnet.SPCTimeVariableControlChart
{
   private class ZoomWithStack : ChartZoom
   {
       public ZoomWithStack(ChartView component, PhysicalCoordinates transform, bool brescale)
           : base(component, transform, brescale)
         {
         }
       public override void OnMouseDown(MouseEventArgs mouseevent)
       {
           if ((mouseevent.Button & MouseButtons.Right) != 0)
               this.PopZoomStack();
           else
               base.OnMouseDown(mouseevent);
       }
   }
   .
   .
   .



VB
Public Class SPCApplicationUserControl1
    Inherits com.quinncurtis.spcchartnet.SPCTimeVariableControlChart

  Private Class ZoomWithStack
    Inherits ChartZoom

    Public Sub New(ByVal component As ChartView, ByVal transform As PhysicalCoordinates, ByVal brescale As Boolean)
      MyBase.New(component, transform, brescale)
    End Sub 'New

    Public Overrides Sub OnMouseDown(ByVal mouseevent As MouseEventArgs)
       If (mouseevent.Button And System.Windows.Forms.MouseButtons.Right) <> 0 Then
           Me.PopZoomStack()
       Else
           MyBase.OnMouseDown(mouseevent)
       End If
    End Sub 'OnMouseDown
  End Class 'ZoomWithStack


Instantiate the ZoomWithStack class at the bottom of the InitializeChart inititialization section.

c#

.
   .
   .
   this.AutoScalePrimaryChartYRange();
   this.AutoScaleSecondaryChartYRange();
   this.RebuildChartUsingCurrentData();

   // Add this code for zooming

   ZoomWithStack zoomObj = new ZoomWithStack(this, this.PrimaryChart.PPhysTransform1, true);
   zoomObj.SetButtonMask(MouseButtons.Left);
   zoomObj.SetZoomYEnable(true);
   zoomObj.SetZoomXEnable(true);
   zoomObj.SetZoomXRoundMode(ChartObj.AUTOAXES_FAR);
   zoomObj.SetZoomYRoundMode(ChartObj.AUTOAXES_FAR);
   zoomObj.SetEnable(true);
   zoomObj.SetZoomStackEnable(true);
   this.SetCurrentMouseListener(zoomObj);

}


VB

.
   .
   Me.AutoScalePrimaryChartYRange()
   Me.AutoScaleSecondaryChartYRange()
   Me.RebuildChartUsingCurrentData()

   ' Add this code for zooming

  Dim zoomObj As New ZoomWithStack(Me, Me.PrimaryChart.PPhysTransform1, True)
  zoomObj.SetButtonMask(System.Windows.Forms.MouseButtons.Left)
  zoomObj.SetZoomYEnable(True)
  zoomObj.SetZoomXEnable(True)
  zoomObj.SetZoomXRoundMode(ChartObj.AUTOAXES_FAR)
  zoomObj.SetZoomYRoundMode(ChartObj.AUTOAXES_FAR)
  zoomObj.SetEnable(True)
  zoomObj.SetZoomStackEnable(True)
   ' set range limits to 0.01, 0.01
  zoomObj.SetZoomRangeLimitsRatio(New Dimension(0.01, 0.01))
  Me.SetCurrentMouseListener(zoomObj)


End Sub 'InitializeChart


It will only work for one chart at a time (PrimaryChart or SecondaryChart).

You can download the complete c# file here: http://quinn-curtis.com/downloadsoftware/examplecode/SPCApplicationWithZoom.txt . You can RENAME the file SPCApplicationUserControl1 and replace the file of the existing name in the SPCApplication1 example program.
Go to Top of Page

fanyorn

3 Posts

Posted - 30 Aug 2009 :  10:26:44  Show Profile  Reply with Quote
By the way, it seems that there is no means to get the subgroup point's index by MouseListener when it was clicked on the chart,right?

Thanks.
Go to Top of Page

quinncurtis

1586 Posts

Posted - 30 Aug 2009 :  11:39:07  Show Profile  Reply with Quote
We are not sure of the context of your question. This is a thread about zooming the SPC charts. Zooming does not select an individual point or subgroup, it just changes the range of the x- and y-scales. Are you talking about zooming, or something more analogous to data tooltips, where an individual point is selected.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Quinn-Curtis Forums © 2000-2018 Quinn-Curtis, Inc. Go To Top Of Page
Powered By: Snitz Forums 2000 Version 3.4.07