highcharts / highcharts-ios

iOS wrapper for Highcharts.
Other
127 stars 39 forks source link

Graph x-axis label start and end values are changing when we rotate the device #348

Closed ArunVicky001 closed 3 years ago

ArunVicky001 commented 4 years ago

Hello Team,

I have set the constraint to the graph when the device is rotated it will automatically rotate and display the graph. but when the device rotates portrait to landscape mode graph xAxis label start and end values are changing. how to maintain the same x-axis label start and end text for both orientations. Could you please suggest this?

let xaxis = HIXAxis()
xaxis.categories = values // values is a array which I am passing to the xaxis 
xaxis.gridLineWidth = 0
xaxis.minorGridLineWidth = 0
xaxis.labels = HILabels()
xaxis.labels.style = HICSSObject()
xaxis.labels.style.color = color
xaxis.opposite = true
xaxis.showFirstLabel = true
xaxis.showLastLabel = true     
xaxis.crosshair = HICrosshair()
xaxis.min = NSNumber(value: 0)
xaxis.max = NSNumber(value: values.count-1) 

Thanks

ihnatmoisieiev commented 4 years ago

Hello @ArunVicky001, could you please attach screenshots for landscape and portrait modes and mark what values are changed?

ArunVicky001 commented 4 years ago
landscape portrait
ihnatmoisieiev commented 3 years ago

Hello @ArunVicky001,

please try to set xAxis.type = "datetime" and check this article.

If it won't work for you, please share all your configurations of HIOptions object.

ArunVicky001 commented 3 years ago

Thanks for your response, I will try and let you know

ihnatmoisieiev commented 3 years ago

Closing due to inactivity.