Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zooming LineChart xAxis on 32bit device doesn't work correctly. #1693

Closed
Fahrenheit-sp opened this issue Oct 21, 2016 · 2 comments
Closed

Zooming LineChart xAxis on 32bit device doesn't work correctly. #1693

Fahrenheit-sp opened this issue Oct 21, 2016 · 2 comments

Comments

@Fahrenheit-sp
Copy link

Fahrenheit-sp commented Oct 21, 2016

Sorry if i misunderstood something, but I've reopened issue #1679 as @liuxuan30 mentioned. Here is some additional info/logs.

I've placed print("e1.x: \(e1.x), e1.y: \(e1.y * phaseY)") in line 404 in LineChartRenderer, right in front of applying transform to entry point. And to print the actual point on chart after applying transform print("point: \(pt)") in line 409.
That's a part of logs what I got on 32bit device:
e1.x: 1477047261.0, e1.y: 18063.0
point: (251.571, 184.381)
e1.x: 1477047293.0, e1.y: 18058.0
point: (251.571, 239.22)

As you can see, the xValues of two points are different, but their x coordinates are the same, which is obviously not correct. And some logs for 64bit device:
e1.x: 1477047638.0, e1.y: 1.08811
point: (259.413942337036, 236.467363886797)
e1.x: 1477047639.0, e1.y: 1.08809
point: (259.638811230659, 239.2275390625)

Here you can see, that xValue of the first point is only 1 lower, than the second one, and their x coordinates on chart are different.

And speaking about labels positions. I've put print("position before applying: \(position)") in line 225 in XAxisRenderer. Right between
position.y = 0.0 position = position.applying(valueToPixelMatrix)

and print("position after applying: \(position)") in line 253, right before drawLabel calling.
Here are the logs for 32bit device:
position before applying: (1.47705e+09, 0.0)
position after applying: (128.611, 221622.0)
position before applying: (1.47705e+09, 0.0)
position after applying: (167.408, 221622.0)
position before applying: (1.47705e+09, 0.0)
position after applying: (167.408, 221622.0)
position before applying: (1.47705e+09, 0.0)
position after applying: (206.206, 221622.0)

As you can see - position for two labels is the same. Here is a screenshot.
screenshot32bit
Here is my properties for chartView:
`chartView.delegate = self

    chartView.chartDescription?.text = ""
    chartView.legend.enabled = false
    chartView.leftAxis.enabled = false        
    chartView.xAxis.labelPosition = .bottom
    chartView.xAxis.labelTextColor = UIColor.white       
    chartView.highlightPerTapEnabled = false
    chartView.highlightPerDragEnabled = false        
    chartView.rightAxis.labelTextColor = UIColor.white

and properties for dataSet:
`set = LineChartDataSet(values: dataEntries, label: quote)

    set.fillAlpha = 0.3
    set.fill = Fill.fillWithLinearGradient(gradient!, angle: 90.0)
    set.drawFilledEnabled = true  
    //disable values and circles
    set.drawCirclesEnabled = false
    set.drawCircleHoleEnabled = false
    set.drawValuesEnabled = false
    set.lineWidth = 2.0
    set.setColor(UIColor.white)
    set.highlightColor = UIColor.white

And here you could see that labels sometimes have complete different space between them, but intervals are the same:
2016-10-21 11 17 03
And on 64bit device, everything works perfect, as I already mentioned.
Thanks again for any help, please tell me if some more information needed.

@danielgindi
Copy link
Collaborator

What's 32-bit?

@danielgindi
Copy link
Collaborator

Joking. Please do not double-post, I've re-opened #1679 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants