2

I've been working with iOS-Charts from Daniel Gindi and it is a GREAT Framework!

However, I've been struggling with this issue for a long time now. I'm using a BarChart and managed to display the correct Values @ the Axis labels.

Now I Don't know why this happens but the labels seem to DISAPPEAR While I'm Scrolling...

Here is a simple example with 2 bars:

enter image description here

And now I Scroll a bit to the Right, and PUFFF! The label is Gone!

enter image description here

// HERE IS MY SETUP CODE:

    func setupChartView() {
    // Default Texts:
    noDataText = ""
    chartDescription?.text = ""

    // xAxis:
    xAxis.drawGridLinesEnabled = false
    xAxis.drawAxisLineEnabled = false
    xAxis.enabled = true
    if (UIScreen.main.nativeBounds.height < iPhone6ScreenHeight) {
        xAxis.yOffset = smallScreenYOffset
    } else {
        xAxis.yOffset = graphLabelYOffset
    }
    xAxis.labelPosition = .bottom
    xAxis.labelFont = defaultTextFont!
    xAxis.labelTextColor = .engieChartGrayColor()
    xAxis.granularity = 1.0

    // Left/Right Axis:
    leftAxis.enabled = false
    rightAxis.drawGridLinesEnabled = false
    rightAxis.drawAxisLineEnabled = false
    rightAxis.drawLabelsEnabled = false
    rightAxis.drawZeroLineEnabled = false

    // Other UI Vars:
    dragEnabled = true
    drawMarkers = false
    drawBordersEnabled = false
    clipValuesToContentEnabled = true
    drawValueAboveBarEnabled = false
    setScaleMinima(4.0, scaleY: 1.0)
    legend.enabled = false
    doubleTapToZoomEnabled = false
    pinchZoomEnabled = false
    resetZoom()
    scaleXEnabled = false
    scaleYEnabled = false

}

Can someone Explain to me why this is?

Thanks, I Really Appreciate the help...

Hernan Arber
  • 1,626
  • 3
  • 22
  • 35

0 Answers0