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

leftAxis line disappears when filling area between two line charts. #4037

Closed
hachinobu opened this issue Jun 21, 2019 · 2 comments
Closed

leftAxis line disappears when filling area between two line charts. #4037

hachinobu opened this issue Jun 21, 2019 · 2 comments

Comments

@hachinobu
Copy link

What did you do?

i use filling area between two line charts.

What did you expect to happen?

A fill should appear between the two line graphs, and the leftAxis line should appear.

What happened instead?

leftAxis line disappears.

not filled filled
Simulator_Screen_Shot_-iPhone_X-_2019-06-21_at_11_41_31 Simulator_Screen_Shot_-iPhone_X-_2019-06-21_at_11_42_06

ℹ Please replace this with of what happened instead.

Charts Environment

Charts version/Branch/Commit Number: 3.3.0
Xcode version:10.2
Swift version:5.0
Platform(s) running Charts:iOS 12.2
macOS version running Xcode: 10.14.5

Is there an easy way to solve this problem?

Is it better to customize it according to IFillFormatter or make it inherit from LineChartRenderer?

@hachinobu
Copy link
Author

To solve this problem, it is necessary to advance the timing of calling renderer.drawData(context: context) in the draw(_ rect: CGRect) method of BarLineChartViewBase.

However, I am worried about the degradation caused by this change.

I will send a PR if there is no problem, how is it?

    // BarLineChartViewBase.swift
    open override func draw(_ rect: CGRect)
    {
        super.draw(rect)

        guard data != nil, let renderer = renderer else { return }
        
        let optionalContext = NSUIGraphicsGetCurrentContext()
        guard let context = optionalContext else { return }

        // execute all drawing commands
        drawGridBackground(context: context)
        renderer.drawData(context: context) // <-- solve this issue.

Simulator Screen Shot - iPhone X - 2019-06-22 at 16 18 54

@liuxuan30
Copy link
Member

please send us a PR, thanks

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