         if coordinate == CPTCoordinate.X {
             axisSet.yAxis?.orthogonalPosition = NSNumber(value:(range.location.doubleValue + TrendViewController.yAxisLabelWidth))
             //axisSet.xAxis?.titleLocation = CPTDecimalFromDouble(range.locationDouble + (range.lengthDouble / 2.0)) as NSNumber?
-        } else {
-            axisSet.xAxis?.orthogonalPosition = range.location
+        } else if (coordinate == CPTCoordinate.Y)
+            && (trend != nil) {
+            axisSet.xAxis?.orthogonalPosition = NSNumber(value:(range.location.doubleValue
+                + TrendViewController.xAxisLabelHeight(trend: trend!)))
             //axisSet.yAxis?.titleLocation = CPTDecimalFromDouble(range.locationDouble + (range.lengthDouble / 2.0)) as NSNumber?
         }
         return range

        return range
    }

    class func globalYRange(trendsAlgorithmModel: TrendsAlgorithmModel?, trend: Trend) -> CPTPlotRange {
        //let rangeEmpty = CPTPlotRange(location: 0.0, length: 0.0)

        var xAxisLabelHeight: Double
        var rangeMaximum: Double

        switch trend {
        case .bg:
            xAxisLabelHeight = 5
            rangeMaximum = 120
        case .ha1c:
            xAxisLabelHeight = 0.5
            rangeMaximum = 11
        }

        let range = CPTPlotRange(location: NSNumber(value: -xAxisLabelHeight),
                                 length: NSNumber(value:rangeMaximum + xAxisLabelHeight))
        return range
    }

    func configureAxes(graph: CPTXYGraph) {

        plotSpace.xRange = TrendViewController.xRange(trendsAlgorithmModel: trendsAlgorithmModel,
                                                      trend: trend)

        plotSpace.globalYRange = TrendViewController.globalYRange(trend: trend)
        plotSpace.yRange = plotSpace.globalYRange!
    }

