         case .ha1c:
             x.orthogonalPosition = 5.0
         }
-
-        // one day per minor tick
-        x.minorTicksPerInterval = UInt(DAYS_IN_ONE_WEEK) - 1
+        configureAxisIntervals(x: x, rangeScale: .day)
+    }
+
+    /**
+     - parameter rangeScale: a RangeScale
+     */
+    func configureAxisIntervals(x: CPTXYAxis, rangeScale: RangeScale) {
+
         x.labelExclusionRanges  = [
             //CPTPlotRange(location: 0.99, length: 0.02),
             //CPTPlotRange(location: 1.99, length: 0.02),
             //CPTPlotRange(location: 2.99, length: 0.02)
         ]
+
+        x.minorTicksPerInterval = 1
+
+        var majorIntervalLength = TrendViewController.minutesPerWeek as NSNumber?
+        print("rangeScale \(rangeScale)")
+        
+        switch rangeScale {
+        case .month:
+            //let dayPerMonth = 30
+            majorIntervalLength = NSNumber(value: Int(DAYS_IN_ONE_WEEK * HOURS_IN_ONE_DAY * MINUTES_IN_ONE_HOUR))
+        case .week:
+            majorIntervalLength = NSNumber(value: Int(DAYS_IN_ONE_WEEK * HOURS_IN_ONE_DAY * MINUTES_IN_ONE_HOUR))
+        case .day:
+            majorIntervalLength = NSNumber(value: (DAYS_IN_ONE_WEEK * HOURS_IN_ONE_DAY * MINUTES_IN_ONE_HOUR))
+        case .hour24, .hour:
+            majorIntervalLength = NSNumber(value: (HOURS_IN_ONE_DAY * MINUTES_IN_ONE_HOUR))
+        }
+        x.majorIntervalLength = majorIntervalLength
     }
 
     func configureAxis(y: CPTXYAxis, trend: Trend) {

        return cptFormatter
    }

    class func rangeScale(_ range: CPTPlotRange?) -> RangeScale {

        guard let axisRange = range else {
            return .month

                + (0.1 * range.lengthDouble)))
            axisSet.xAxis?.labelFormatter = xLabelFormatter(range: range)

            if let xAxis = axisSet.xAxis {
                let rangeScale = TrendViewController.rangeScale(range: range)
                configureAxisIntervals(x: xAxis, rangeScale: rangeScale)
            }

        } else if (coordinate == CPTCoordinate.Y) && (trend != nil) {

            // keep original range, don't change to newRange
