Subhankar
Subhankar

Reputation: 45

How to shift data on xAxis to right on Daniel Gindi charts?

I have a data chart DataChart would like to shift data of xAxis along with data lines to right by certain value.

DataChart Screen Shot

Screen Shot

Please help me out which property to use from the library that would be able to solve this purpose.

I am using Daniel Gindi line charts for this purpose.

Upvotes: 1

Views: 872

Answers (2)

Alex
Alex

Reputation: 488

I use this to create an offset to the left of my chart

myChart.xAxis.spaceMin = 10

maybe it'll do for you

And to align the yAxis lines in front of the labels, i think you could remove the background grid and create your own limit lines if you don't find any other way around

Upvotes: 1

chartman
chartman

Reputation: 182

is it viable to subtract the distance d from the x values? that would shift it rightward.

d = 7.0

rightShifted = newGraphData.values.map{ChartDataEntry(x:$0.x-d, y:$0.y)}

Upvotes: 0

Related Questions