コード例 #1
0
        private DataColumn createRelatedColumnFor(DataTable dataTable, DataColumn dataColumn, AuxiliaryType auxiliaryType, string caption)
        {
            if (!dataColumn.ContainsRelatedColumn(auxiliaryType))
            {
                return(null);
            }

            var realatedColumn = dataColumn.GetRelatedColumn(AuxiliaryType.ArithmeticStdDev);

            if (realatedColumn == null)
            {
                return(null);
            }

            var errCol = dataTable.AddColumn <float>(realatedColumn.Name);

            errCol.SetUnit(realatedColumn.DataInfo.DisplayUnitName);
            errCol.SetNotes(new[] { caption });
            return(realatedColumn);
        }
コード例 #2
0
        protected override bool AddRelatedValuesToRow(DataRow row, DataColumn yData, IDimension yDimension, Unit yUnit, double y, float baseValue)
        {
            var relatedColumn = yData.GetRelatedColumn(AuxiliaryType.ArithmeticStdDev);
            var stdDev        = yDimension.BaseUnitValueToUnitValue(yUnit, relatedColumn.GetValue(baseValue));

            if (!IsValidValue(stdDev))
            {
                stdDev = 0;
            }

            row[HIGH] = y + stdDev;
            row[LOW]  = y - stdDev;
            row[Y2]   = y;

            if (!IsValidYValue(y - stdDev))
            {
                row[LOW] = y;
            }

            return(true);
        }
コード例 #3
0
        protected override bool AddRelatedValuesToRow(DataRow row, DataColumn yData, IDimension yDimension, Unit yUnit, double y, float baseValue)
        {
            var relatedColumn = yData.GetRelatedColumn(AuxiliaryType.GeometricStdDev);
            var stdDev        = relatedColumn.GetValue(baseValue);

            if (!IsValidValue(stdDev) || stdDev == 0)
            {
                stdDev = 1;
            }

            if (!IsValidYValue(y / stdDev))
            {
                return(false);
            }

            row[LOW]  = y / stdDev;
            row[HIGH] = y * stdDev;
            row[Y2]   = y;

            return(true);
        }