Question: when I try to view my chart, all data on the x-axis are not displayed.
Here an exemple: <http://jsfiddle.net/zn4y45pL/>

```
options.xAxis.categories.push(this.innerHTML);
alert(this.innerHTML);

```

This shows me all the data.

Any ideas on what's the problem?
Thanks!

Answer: 
edit/update:
**Xcode 11.5 • Swift 5.2**

```
extension FloatingPoint {
    func converting(from input: ClosedRange<Self>, to output: ClosedRange<Self>) -> Self {
        let x = (output.upperBound - output.lowerBound) * (self - input.lowerBound)
        let y = (input.upperBound - input.lowerBound)
        return x / y + output.lowerBound
    }
}

```

---

```
extension BinaryInteger {
    func converting(from input: ClosedRange<Self>, to output: ClosedRange<Self>) -> Self {
        let x = (output.upperBound - output.lowerBound) * (self - input.lowerBound)
        let y = (input.upperBound - input.lowerBound)
        return x / y + output.lowerBound
    }
}

```

---

```
let integer = 380
let result = integer.converting(from: 10...750, to: 100...350) // 225

let double = 750.0
let result = double.converting(from: 10.1...750.0, to: 0...350) // 350

```
Here is the Swift 3 compatible version, which also supports generics (to not bound Rescale just for Doubles).

```
struct Rescale<Type : BinaryFloatingPoint> {
    typealias RescaleDomain = (lowerBound: Type, upperBound: Type)

    var fromDomain: RescaleDomain
    var toDomain: RescaleDomain

    init(from: RescaleDomain, to: RescaleDomain) {
        self.fromDomain = from
        self.toDomain = to
    }

    func interpolate(_ x: Type ) -> Type {
        return self.toDomain.lowerBound * (1 - x) + self.toDomain.upperBound * x;
    }

    func uninterpolate(_ x: Type) -> Type {
        let b = (self.fromDomain.upperBound - self.fromDomain.lowerBound) != 0 ? self.fromDomain.upperBound - self.fromDomain.lowerBound : 1 / self.fromDomain.upperBound;
        return (x - self.fromDomain.lowerBound) / b
    }

    func rescale(_ x: Type )  -> Type {
        return interpolate( uninterpolate(x) )
    }
}

```

Example would be:

```
Rescale(from: (15, 85), to: (0, 100)).rescale(85)

```