See attached .js and .html to duplicate.
Using the pushGetJSONOverallStatistics(), calculated control limits are retrieved and stored. We then display these stored limits when the chart is displayed.
In the attached .js file, you can see where I am setting the control limits as:
"ControlLimits": {
"DefaultLimits": [
true,
true
],
"Target": {
"EnableAlarmLine": true,
"EnableAlarmChecking": true,
"LimitValue": 3.225,
"DisplayString": "Target"
},
"LCL3": {
"LimitValue": 0.8548125074163435,
"DisplayString": "LCL"
},
"UCL3": {
"LimitValue": 5.595187492583657,
"DisplayString": "UCL"
}
}
However, when the chart is displayed, the control limits appear as 14,10, 6.
JS FILE:
var TruboxChart =
{
"StaticProperties": {
"Canvas": {
"Width": 1918,
"Height": 582
},
"DefaultTableFont": {
"Name": "sans-serif",
"Size": 12.0,
"Style": "PLAIN"
},
"DefaultAlarmColors": {
"Target": "MEDIUMSEAGREEN",
"LowAlarm": "DARKBLUE",
"HighAlarm": "ORANGE"
},
"DefaultChartFonts": {
"AxisLabelFont": {
"Name": "sans-serif",
"Size": 12.0,
"Style": "PLAIN"
},
"AxisTitleFont": {
"Name": "sans-serif",
"Size": 12.0,
"Style": "PLAIN"
},
"MainTitleFont": {
"Name": "sans-serif",
"Size": 18.0,
"Style": "PLAIN"
},
"SubHeadFont": {
"Name": "sans-serif",
"Size": 12.0,
"Style": "PLAIN"
},
"ToolTipFont": {
"Name": "sans-serif",
"Size": 12.0,
"Style": "PLAIN"
},
"AnnotationFont": {
"Name": "sans-serif",
"Size": 12.0,
"Style": "PLAIN"
},
"ControlLimitLabelFont": {
"Name": "sans-serif",
"Size": 12.0,
"Style": "PLAIN"
}
}
},
"SPCChart": {
"InitChartProperties": {
"SPCChartType": "PERCENT_DEFECTIVE_PARTS_CHART_VSS",
"ChartMode": "Batch",
"NumSamplesPerSubgroup": 500,
"NumDatapointsInView": 12,
"TimeIncrementMinutes": 0.0,
"NumCategories": 1
},
"ChartPositioning": {
"GraphStartPosX": 0.125,
"InterGraphMargin": 0.1
},
"Scrollbar": {
"EnableScrollBar": true,
"ScrollbarPosition": "SCROLLBAR_POSITION_MAX"
},
"TableSetup": {
"HeaderStringsLevel": "HEADER_STRINGS_LEVEL2",
"EnableInputStringsDisplay": true,
"EnableCategoryValues": true,
"EnableSampleValues": true,
"EnableCalculatedValues": true,
"EnableTotalSamplesValues": true,
"EnableNotes": false,
"EnableTimeValues": false,
"EnableNotesToolTip": false,
"TableBackgroundMode": "TABLE_NO_COLOR_BACKGROUND",
"TableAlarmEmphasisMode": "ALARM_HIGHLIGHT_OUTLINE",
"ChartAlarmEmphasisMode": "ALARM_HIGHLIGHT_SYMBOL",
"ChartData": {
"Title": "SPC_TEST_PRODUCT - SPC Test Product",
"PartName": "P Chart Test - FINAL",
"Operator": "ATT_CHAR_03 - Functional Requirements ()",
"DateString": "05/07/2018 - 06/10/2018",
"SampleRowHeaderStrings": [
"Total Defects"
],
"TitleHeader": "Product ID: ",
"PartNumberHeader": "",
"ChartNumberHeader": "",
"PartNameHeader": "Operation No: ",
"OperationHeader": "",
"SpecificationLimitsHeader": "",
"OperatorHeader": "Char No: ",
"MachineHeader": "",
"GaugeHeader": "",
"UnitOfMeasureHeader": "",
"ZeroEqualsHeader": "",
"DateHeader": "Dates: ",
"NotesHeader": ""
}
},
"MiscChartDataProperties": {},
"PrimaryChartSetup": {
"XAxisLabels": {
"Format": "TIMEDATEFORMAT_24HM",
"AxisLabelMode": "AXIS_LABEL_MODE_TIME",
"CustomFormatString": "MM/dd/yy\nHH:mm",
"Font": {
"Name": "sans-serif",
"Size": 11.0,
"Style": "PLAIN"
}
},
"ControlLimits": {
"DefaultLimits": [
true,
true
],
"Target": {
"EnableAlarmLine": true,
"EnableAlarmChecking": true,
"LimitValue": 3.225,
"DisplayString": "Target"
},
"LCL3": {
"LimitValue": 0.8548125074163435,
"DisplayString": "LCL"
},
"UCL3": {
"LimitValue": 5.595187492583657,
"DisplayString": "UCL"
}
}
},
"Events": {
"AlarmStateEventEnable": true,
"EnableDataToolTip": true,
"EnableJSONDataToolTip": false,
"DataToolTip": {
"EnableProcessCapabilityValues": true,
"EnableCalculatedValues": true
},
"EnableNotesToolTip": true
},
"SampleData": {
"SampleIntervalRecords": [
{
"TimeStamp": 1525696200000,
"BatchCount": 0,
"SampleSubgroupSize_VSS": 500,
"SampleValues": [
12.0
]
},
{
"TimeStamp": 1525752000000,
"BatchCount": 1,
"SampleSubgroupSize_VSS": 500,
"SampleValues": [
15.0
]
},
{
"TimeStamp": 1526014800000,
"BatchCount": 2,
"SampleSubgroupSize_VSS": 500,
"SampleValues": [
19.0
]
},
{
"TimeStamp": 1526103000000,
"BatchCount": 3,
"SampleSubgroupSize_VSS": 500,
"SampleValues": [
13.0
]
},
{
"TimeStamp": 1526193000000,
"BatchCount": 4,
"SampleSubgroupSize_VSS": 500,
"SampleValues": [
9.0
]
},
{
"TimeStamp": 1526301000000,
"BatchCount": 5,
"SampleSubgroupSize_VSS": 500,
"SampleValues": [
26.0
]
},
{
"TimeStamp": 1526405400000,
"BatchCount": 6,
"SampleSubgroupSize_VSS": 500,
"SampleValues": [
18.0
]
},
{
"TimeStamp": 1526679000000,
"BatchCount": 7,
"SampleSubgroupSize_VSS": 500,
"SampleValues": [
14.0
]
},
{
"TimeStamp": 1526725800000,
"BatchCount": 8,
"SampleSubgroupSize_VSS": 500,
"SampleValues": [
17.0
]
},
{
"TimeStamp": 1526819400000,
"BatchCount": 9,
"SampleSubgroupSize_VSS": 500,
"SampleValues": [
18.0
]
},
{
"TimeStamp": 1526923800000,
"BatchCount": 10,
"SampleSubgroupSize_VSS": 500,
"SampleValues": [
16.0
]
},
{
"TimeStamp": 1527006600000,
"BatchCount": 11,
"SampleSubgroupSize_VSS": 500,
"SampleValues": [
24.0
]
},
{
"TimeStamp": 1527370200000,
"BatchCount": 12,
"SampleSubgroupSize_VSS": 500,
"SampleValues": [
11.0
]
},
{
"TimeStamp": 1527393600000,
"BatchCount": 13,
"SampleSubgroupSize_VSS": 500,
"SampleValues": [
31.0
]
},
{
"TimeStamp": 1527483600000,
"BatchCount": 14,
"SampleSubgroupSize_VSS": 500,
"SampleValues": [
16.0
]
},
{
"TimeStamp": 1527584400000,
"BatchCount": 15,
"SampleSubgroupSize_VSS": 500,
"SampleValues": [
10.0
]
},
{
"TimeStamp": 1527876000000,
"BatchCount": 16,
"SampleSubgroupSize_VSS": 500,
"SampleValues": [
16.0
]
},
{
"TimeStamp": 1527964200000,
"BatchCount": 17,
"SampleSubgroupSize_VSS": 500,
"SampleValues": [
17.0
]
},
{
"TimeStamp": 1528054200000,
"BatchCount": 18,
"SampleSubgroupSize_VSS": 500,
"SampleValues": [
20.0
]
},
{
"TimeStamp": 1528165800000,
"BatchCount": 19,
"SampleSubgroupSize_VSS": 500,
"SampleValues": [
15.0
]
},
{
"TimeStamp": 1528207200000,
"BatchCount": 20,
"SampleSubgroupSize_VSS": 500,
"SampleValues": [
8.0
]
},
{
"TimeStamp": 1528459200000,
"BatchCount": 21,
"SampleSubgroupSize_VSS": 500,
"SampleValues": [
13.0
]
},
{
"TimeStamp": 1528531200000,
"BatchCount": 22,
"SampleSubgroupSize_VSS": 500,
"SampleValues": [
12.0
]
},
{
"TimeStamp": 1528614000000,
"BatchCount": 23,
"SampleSubgroupSize_VSS": 500,
"SampleValues": [
17.0
]
}
]
},
"Methods": {
"AutoCalculateControlLimits": [
false,
false
],
"AutoScaleYAxes": [
true,
true
],
"RebuildUsingCurrentData": true
}
}
};
HTML:
<!doctype html>
<!-- The DOCTYPE declaration above will set the -->
<!-- browser's rendering engine into -->
<!-- "Standards Mode". Replacing this declaration -->
<!-- with a "Quirks Mode" doctype is not supported. -->
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<!-- -->
<!-- Consider inlining CSS to reduce the number of requested files -->
<!-- -->
<link type="text/css" rel="stylesheet" href="QCSPCChartGWT.css">
<!-- -->
<!--Specify the chart defining javascript file containing JSON script -->
<!-- -->
<script src="trubox_chart.js"></script>
<script>
function processJSONScriptClick( )
{
var s = JSON.stringify(TruboxChart,undefined,2);
pushJSONChartCreateDiv(s, "iqs_qcspcchartgwt_destination");
}
</script>
<!-- -->
<!-- This script loads your compiled module. -->
<!-- If you add any GWT meta tags, they must -->
<!-- be added before this line. -->
<!-- -->
<script type="text/javascript" language="javascript" src="qcspcchartgwt/qcspcchartgwt.nocache.js"></script>
</head>
<body>
<!-- OPTIONAL: include this if you want history support -->
<iframe src="javascript:''" id="__gwt_historyFrame" tabIndex='-1' style="position:absolute;width:0;height:0;border:0"></iframe>
<!-- RECOMMENDED if your web app will not function without JavaScript enabled -->
<noscript>
<div style="width: 22em; position: absolute; left: 50%; margin-left: -11em; color: red; background-color: white; border: 1px solid red; padding: 4px; font-family: sans-serif">
Your web browser must have JavaScript enabled
in order for this application to display correctly.
</div>
</noscript>
<div id="iqs_qcspcchartgwt_destination">
</div>
<INPUT TYPE="button" NAME="displayJSONScript" VALUE="Display JSON Script " onClick="processJSONScriptClick();">
</body>
</html>