public TrendMarkerWriter(ProfileDataWriter profileDataWriter, TrendMarkersProvider trendMarkersProvider, 
     TrendMarkerLabelProvider trendMarkerLabelProvider)
 {
     _profileDataWriter = profileDataWriter;
     _trendMarkersProvider = trendMarkersProvider;
     _trendMarkerLabelProvider = trendMarkerLabelProvider;
 }
        public static ITrendMarkerWriter New(ProfileDataWriter profileDataWriter, int polarityId, IList<TimePeriod> timePeriods, bool hasTrendMarkers)
        {
            if (hasTrendMarkers && timePeriods.Count >= TrendMarkerCalculator.MinimumNumberOfPoints)
            {
                // Use null for TrendReader as all data will be provided to the provider
                var trendMarkerLabelProvider = new TrendMarkerLabelProvider(polarityId);
                var trendMarkerProvider = new TrendMarkersProvider(null, new TrendMarkerCalculator());
                return new TrendMarkerWriter(profileDataWriter, trendMarkerProvider, trendMarkerLabelProvider);
            }

            return new NullTrendMarkerWriter();
        }