SChartRange not respected


#1

No matter what I try my SChartRange is not rendering right. It always cuts off data from the right of my line chart

var xAxis = SChartNumberAxis()
    let numberRnage = SChartRange(minimum: 0, maximum: 289)
    xAxis.range = numberRnage
    xAxis.defaultRange = numberRnage
    xAxis.majorTickFrequency = 1

I want the data to show between 0 -289 points
it only ever shows between 0 - 190


#2

The issue was I was trying to draw the tick marks on the inside of the graph by doing this:

yAxis.style.majorTickStyle.tickGap = -200

which messed everything up

Now brings me to another question, how to draw the tick marks inside plot area?


#3

Hi rches,

We’re sorry you’re having issues with displaying the tick labels inside the chart. It looks as though there is a bug in our axis width calculation code, meaning it doesn’t cater for negative tick gaps, so the chart’s plot area ends up bigger than the chart itself, resulting in the behaviour you saw.

We’ve logged the bug, but we do not yet have an estimate on when it will be fixed. We’ll update this post when a fix is released.

The good news is that you can work around the issue by manually setting the axis width to the width of the axis line, e.g.:

yAxis.width = 2

I hope that fixes the issue for now.

Kind regards,

Alison