GetChartDataByFilter(String,String,String,String,String,String,String,String,String,String,String,String,String,String,Nullable<DateTime>,Nullable<DateTime>,Nullable<Int32>,Int32,DateTime,AxisLabel) Method
- Last UpdatedNov 06, 2025
- 7 minute read
For the specified characteristic, the GetChartDataByFilter() method retrieves the chart data for all samples that match the filter parameters. Passing no filter parameters will retrieve all the measurements for all of the characteristic's samples.
This overload of the method retrieves the chart data by characteristic, site, and entity names.
This overload also includes:
- The lastCreatedAtUtc input parameter, which allows you to filter on samples whose results were added on or after a specified date and time.
- The axisLabel input parameter, which allows you to specify on what to base the label for the chart's x-axis.
'Declaration
Public Overloads Shared Function GetChartDataByFilter( _
ByVal characteristicName As String, _
ByVal siteName As String, _
ByVal entityName As String, _
ByVal item As String, _
ByVal itemCategoryName As String, _
ByVal workOrderId As String, _
ByVal operationId As String, _
ByVal processId As String, _
ByVal segmentRequirementId As String, _
ByVal segmentResponseId As String, _
ByVal spare1 As String, _
ByVal spare2 As String, _
ByVal spare3 As String, _
ByVal spare4 As String, _
ByVal startTime As Nullable(Of Date), _
ByVal endTime As Nullable(Of Date), _
ByVal numberOfPoints As Nullable(Of Integer), _
ByVal chartType As Integer, _
ByVal lastCreatedAtUtc As Date, _
ByVal axisLabel As AxisLabel _
) As DataSet
'Usage
Dim characteristicName As String
Dim siteName As String
Dim entityName As String
Dim item As String
Dim itemCategoryName As String
Dim workOrderId As String
Dim operationId As String
Dim processId As String
Dim segmentRequirementId As String
Dim segmentResponseId As String
Dim spare1 As String
Dim spare2 As String
Dim spare3 As String
Dim spare4 As String
Dim startTime As Nullable(Of Date)
Dim endTime As Nullable(Of Date)
Dim numberOfPoints As Nullable(Of Integer)
Dim chartType As Integer
Dim lastCreatedAtUtc As Date
Dim axisLabel As AxisLabel
Dim value As DataSet
value = Sample.GetChartDataByFilter(characteristicName, siteName, entityName, item, itemCategoryName, workOrderId, operationId, processId, segmentRequirementId, segmentResponseId, spare1, spare2, spare3, spare4, startTime, endTime, numberOfPoints, chartType, lastCreatedAtUtc, axisLabel)
public static DataSet GetChartDataByFilter(
string characteristicName,
string siteName,
string entityName,
string item,
string itemCategoryName,
string workOrderId,
string operationId,
string processId,
string segmentRequirementId,
string segmentResponseId,
string spare1,
string spare2,
string spare3,
string spare4,
Nullable<DateTime> startTime,
Nullable<DateTime> endTime,
Nullable<int> numberOfPoints,
int chartType,
DateTime lastCreatedAtUtc,
AxisLabel axisLabel
)
Parameters
- characteristicName
- Required. Holds the name of the characteristic being charted.
- siteName
- Optional filter parameter. Holds the name of the site to which the supplied entity belongs. Must be null if sites are not being used.
- entityName
- Optional filter parameter. Holds the name of the entity of a sample.
- item
- Optional filter parameter. Holds the item ID of a sample.
- itemCategoryName
- Optional filter parameter. Holds the name of an item category. Any samples of items included in the category will match this filter.
- workOrderId
- Optional filter parameter. Holds the work order ID of a job for which a sample was pulled.
- operationId
- Optional filter parameter. Holds the ID of an operation that is associated with the characteristic. This parameter will filter on the oper_id column of the Sample table. This parameter is used in conjunction with the processId parameter. The combination of a process and an operation in that process is entered as a context property of a QM specification that is linked to the characteristic. For more information, see Remarks below.
- processId
- Optional filter parameter. Holds the ID of a process that is associated with the characteristic. This parameter is used in conjunction with the operationId parameter. The combination of a process and an operation in that process is entered as a context property of a QM specification that is linked to the characteristic. For more information, see Remarks below.
- segmentRequirementId
- Optional filter parameter. Holds the segment requirement ID of a sample.
- segmentResponseId
- Optional filter parameter. Holds the segment response ID of a sample.
- spare1
- Optional filter parameter. Holds the contents of the spare1 field for a sample.
- spare2
- Optional filter parameter. Holds the contents of the spare2 field for a sample.
- spare3
- Optional filter parameter. Holds the contents of the spare3 field for a sample.
- spare4
- Optional filter parameter. Holds the contents of the spare4 field for a sample.
- startTime
- Optional filter parameter. Holds the earliest date/time that a matching sample can have. The date/time are assumed to be in the local time of the calling client application. This is converted to UTC, which is then used to filter on the requested_time_utc column of the Sample table.
- endTime
- Optional filter parameter. Holds the latest date/time that a matching sample can have. The date/time are assumed to be in the local time of the calling client application. This is converted to UTC, which is then used to filter on the requested_time_utc column of the Sample table.
- numberOfPoints
- Optional filter parameters. Specifies the maximum number of data points that will be returned for the chart. If null, all data points are included in the chart.
- chartType
Required. An enumeration that indicates the chart type.
2 = Xbar + Range
3 = Xbar + Sigma
5 = IX + IR
7 = MA + Range
8 = MA + Sigma
16 = p
17 = np
18 = u
19 = c
20 = DPMO
- lastCreatedAtUtc
- Required. Specifies the date and time in UTC to filter the chart data by only samples that have had results added at that date and time or later. This parameter will filter on the created_at_utc column of the Result table.
- axisLabel
Optional. A code that indicates on what to base the text string to use as the chart's x-axis label.
- The source for codes 1 to 3 will be the value in the requested_time_local column of the sample record in the Sample table.
- The source for codes 4 to 22 will be the values in the corresponding columns of the sample record in the Sample table.
- The source for code 23 will be the value in the equipment column of the link record in the Sample_Char_Link table.
The codes are:
0 = sample number (the default; an incremental number generated by the chart)
1 = time
2 = date
3 = date and time
4 = sample name
5 = entity name
6 = item description
7 = work order ID
8 = operation ID
9 = sample frequency name
10 = sample plan name
11 = segment requirement ID
12 = segment response ID
13 = lot number
14 = sublot number
15 = user who pulled the sample
16 = local date and time when the sample was pulled
17 = user who verified the sample results
18 = spare1 field
19 = spare2 field
20 = spare3 field
21 = spare4 field
22 = QM specification name
23 = equipment used to make characteristic measurements for the sample
Return Value
Returns a DataSet that contains the chart data for all the samples collected for the specified characteristic that match the supplied filters.
The columns of the returned DataSet are described below.
| Column Name | Description |
|---|---|
| sample_id | An integer that is the ID of the sample from which the characteristic measurement came. From the Sample table. |
| primary_cl | A double that is center line for the primary graph in the chart. From the QM_Spec_Char_Link or Characteristic table. |
| primary_lcl | A double that is the lower control limit for the primary graph in the chart. From the QM_Spec_Char_Link or Characteristic table. |
| primary_ucl | A double that is the upper control limit for the primary graph in the chart. From the QM_Spec_Char_Link or Characteristic table. |
| secondary_cl | A double that is the center line for the secondary graph in the chart. From the QM_Spec_Char_Link or Characteristic table. |
| secondary_lcl | A double that is the lower control limit for the secondary graph in the chart. From the QM_Spec_Char_Link or Characteristic table. |
| secondary_ucl | A double that is the upper control limit for the secondary graph in the chart. From the QM_Spec_Char_Link or Characteristic table. |
| requested_time_local | A datetime that is the time when the sample was requested in the local time of the entity at which the sample was collected. From the Sample table. |
| requested_time_utc | A datetime that is the time when the sample was requested in UTC. From the Sample table. |
| requested_time | A datetime that is the time when the sample was requested in the local time of the client application that is making the call. This value is calculated from the UTC date/time value and the call's time zone information. |
| note | A string that is the notes for the sample-characteristic pair. From the Sample_Char_Link table. |
| value_no | An integer that is the index of the measurement within the sample. From the Result table. |
| result_value | A double that is the value of the measurement. From the Result table. |
| act_sample_size | An integer that is the size of the sample if individual measurements are not being stored. From the Sample_Char_Link table. |
| created_at_utc | A datetime that is the time when the result was entered, in UTC. From the Result table. |
| cause_id | An integer that is the ID of the cause for the sample. From the Sample_Char_Link table. |
| cause_desc | A string that is the description of the cause. From the Cause table. |
| ignore_sample | A Boolean flag that specifies whether the sample should be ignored when calculating statistics and control rule violations for the characteristic. From the Sample_Char_Link table. |
| control_move | A Boolean flag that specifies whether there was a change to an environmental factor for the sample that would render old control limits obsolete. From the Sample_Char_link table. |
| x_axis_label | A string that is the x-axis label. The source for the label is based on the value passed for the xAxisLabel input parameter. If no value was passed, the label is the sample number, which is an incremental number generated by the chart. |
The center line and control limits returned from each point are obtained from the characteristic or from the overrides assigned to the QM specification assigned to the sample-characteristic pair. If a QM specification is assigned to the sample-characteristic pair and the QM specification has override values, those values are used. Otherwise, the values assigned to the characteristic are used.
Note that the chartType and xAxisLabel parameters are not filter parameters. They are used to override the chart type and x-axis label that is associated by default with the characteristic. Also, the numberOfPoints parameter is not a filter parameter per se but can be used to limit the amount of chart data that is being returned.
The context properties of the QM specifications that are linked to a characteristic are used to determine the conditions under which samples for that characteristic will be generated. A QM specification must have an entry for at least one of the three context properties: Entity, Item Category and Item, Process and Operation (see the operationId and processId filter parameters). For more information about QM specifications and characteristics, see the MES Client User Guide or help.