Пример #1
0
        protected override void Context()
        {
            base.Context();

            _observedCurveDataList = new List <ObservedCurveData>();
            _observedCurveData     = new ObservedCurveData(AuxiliaryType.Undefined)
            {
                Caption = "Male"
            };

            _observedCurveDataList.Add(_observedCurveData);
            _observedCurveData.Color = Color.Aqua;

            A.CallTo(_observedCurveDataMapper).WithReturnType <IReadOnlyList <ObservedCurveData> >().Returns(_observedCurveDataList);

            _statisticalAnalysis.SetPosition(_genderField, PivotArea.RowArea, 0);
            _statisticalAnalysis.SetPosition(_outputFieldVenousBloodPlasma, PivotArea.DataArea, 0);
            _statisticalAnalysis.SetPosition(_outputFieldLiverCell, PivotArea.DataArea, 1);
            _predefinedStatisticalAggregation.Method   = StatisticalAggregationType.ArithmeticMean;
            _percentileStatisticalAggregation.Selected = true;

            _observedDataCollection = new ObservedDataCollection {
                ApplyGroupingToObservedData = true
            };
            var observedData = DomainHelperForSpecs.ObservedData();

            observedData.ExtendedProperties.Add(new ExtendedProperty <string> {
                Name = _genderField.Name, Value = "Male"
            });
            _observedDataCollection.AddObservedData(observedData);

            _pivotResult = ChartDataHelperForSpecs.CreateOutputResults(_statisticalAnalysis, _genderField, _outputFieldVenousBloodPlasma, _outputFieldLiverCell, _observedDataCollection);
        }
Пример #2
0
 private static void updateCurveOptions(CurveOptions curveOptions, ObservedCurveData observedCurve)
 {
     observedCurve.Color     = curveOptions.Color;
     observedCurve.LineStyle = curveOptions.LineStyle;
     observedCurve.Symbol    = curveOptions.Symbol;
     observedCurve.Visible   = curveOptions.Visible;
 }
        private Series createExtremSeries(ObservedCurveData observedCurveData, Func <ObservedDataYValue, float> extremValue, MarkerKind markerKind)
        {
            var series = CreateSeries(observedCurveData, ViewType.Point)
                         .WithPoints(CreateSeriesPoints(observedCurveData, extremValue));

            var pointView = series.View.DowncastTo <PointSeriesView>();

            pointView.PointMarkerOptions.Kind = markerKind;
            pointView.PointMarkerOptions.Size = 4;
            return(series);
        }
        private PlotOptions getPlotOptionsFor(ObservedCurveData observedCurveData)
        {
            var plotOptions = GetPlotOptions(color: observedCurveData.Color.Name,
                                             shadedErrorBars: false,
                                             lineStyle: GetLineStyle(observedCurveData.LineStyle),
                                             marker: TEXHelper.GetMarker(observedCurveData.Symbol));

            plotOptions.ErrorType     = TEXHelper.GetErrorType(observedCurveData.ErrorType);
            plotOptions.ErrorBars     = true;
            plotOptions.ThicknessSize = Helper.Length(1, Helper.MeasurementUnits.pt);
            plotOptions.MarkSize      = Helper.Length(1, Helper.MeasurementUnits.pt);
            return(plotOptions);
        }
        private List <Coordinate> getCoordinatesFor(ObservedCurveData observedCurveData, IDimension xdimension, Unit xunit, IDimension ydimension, Unit yunit)
        {
            var coordinates = new List <Coordinate>();

            for (var i = 0; i < observedCurveData.YValues.Count; i++)
            {
                var xValue = TEXHelper.ValueInDisplayUnit(xdimension, xunit, observedCurveData.XValues[i].X);
                var yValue = TEXHelper.ValueInDisplayUnit(ydimension, yunit, observedCurveData.YValues[i].Y);
                var error  = TEXHelper.ValueInDisplayUnit(ydimension, yunit, observedCurveData.YValues[i].Error);
                coordinates.Add(new Coordinate(xValue, yValue)
                {
                    errY = error
                });
            }
            return(coordinates);
        }
        private ObservedCurveData createCurveData(DataColumn observedDataColumn, ObservedDataCurveOptions observedDataCurveOptions)
        {
            if (string.IsNullOrEmpty(observedDataCurveOptions.Caption))
            {
                //use null here as observed data do not belong to any simulation
                observedDataCurveOptions.Caption = _displayPathMapper.DisplayPathAsStringFor(null, observedDataColumn);
            }

            var observedCurve = new ObservedCurveData(errorTypeFrom(observedDataColumn))
            {
                Id      = observedDataColumn.Id,
                Caption = observedDataCurveOptions.Caption,
            };

            updateCurveOptions(observedDataCurveOptions.CurveOptions, observedCurve);

            return(observedCurve);
        }
        protected override IReadOnlyList <Series> CreateObservedDataSeriesList(ObservedCurveData observedCurveData)
        {
            Series meanPoints = null, meanLine = null;
            var    series = new List <Series>();

            if (!observedCurveData.Visible)
            {
                return(series);
            }

            if (observedCurveData.Symbol != Symbols.None)
            {
                meanPoints = CreateSeries(observedCurveData, ViewType.Point)
                             .WithPoints(CreateSeriesPoints(observedCurveData, y => y.Mean));
            }

            if (observedCurveData.LineStyle != LineStyles.None)
            {
                meanLine = CreateLineSeries(observedCurveData)
                           .WithPoints(CreateSeriesPoints(observedCurveData, y => y.Mean));
            }

            series.AddRange(new[] { meanPoints, meanLine });
            if (observedCurveData.ErrorType == AuxiliaryType.Undefined)
            {
                return(series);
            }

            var verticalLine = CreateFinancialSeries(observedCurveData)
                               .WithPoints(CreateSeriesPoints(observedCurveData, y => y.LowerValue, y => y.UpperValue, y => y.Mean, y => y.Mean));

            var upperPoint = createExtremSeries(observedCurveData, y => y.UpperValue, MarkerKind.InvertedTriangle);
            var lowerPoint = createExtremSeries(observedCurveData, y => y.LowerValue, MarkerKind.Triangle);

            series.AddRange(new[] { upperPoint, lowerPoint });
            //puts the vertical line first so that it will be the one visible in legend
            series.Insert(0, verticalLine);

            return(series);
        }
Пример #8
0
 protected virtual IReadOnlyList <Series> CreateObservedDataSeriesList(ObservedCurveData observedCurveData)
 {
     return(new List <Series>());
 }
Пример #9
0
        private void addLegendEntry(ObservedCurveData curve, List <string> legendEntries)
        {
            var legendEntry = GetLegendEntry(curve);

            addLegendEntry(legendEntry, legendEntries);
        }
Пример #10
0
 protected static string GetLegendEntry(ObservedCurveData curve)
 {
     return(curve.Caption);
 }