Exemplo n.º 1
0
        public override Task <ModelAxis> MapToModel(SnapshotAxis snapshot, SnapshotContext snapshotContext)
        {
            var axis = new ModelAxis(snapshot.Type)
            {
                Dimension        = _dimensionRepository.DimensionByName(snapshot.Dimension),
                Caption          = snapshot.Caption,
                GridLines        = snapshot.GridLines,
                Visible          = snapshot.Visible,
                DefaultColor     = snapshot.DefaultColor,
                DefaultLineStyle = snapshot.DefaultLineStyle,
                Scaling          = snapshot.Scaling,
                NumberMode       = snapshot.NumberMode
            };

            axis.Dimension = _dimensionRepository.OptimalDimensionFor(axis.Dimension);
            axis.UnitName  = ModelValueFor(snapshot.Unit);
            axis.Min       = snapshot.Min;
            axis.Max       = snapshot.Max;

            return(Task.FromResult(axis));
        }