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

Modify Marker before showing value #2294

Closed
gsolanki1509 opened this issue Mar 28, 2017 · 6 comments
Closed

Modify Marker before showing value #2294

gsolanki1509 opened this issue Mar 28, 2017 · 6 comments

Comments

@gsolanki1509
Copy link

Hi Guys,

How can i get the customize the value of selected bar before it gets shown in marker?

As i'm passing double values to x-Axis but when user click on particular bar i have to convert it to hh:mm

Thanks in advance..!!

@gsolanki1509
Copy link
Author

For more info. Please check below screenshot

screen shot 2017-03-28 at 1 57 18 pm

@thierryH91200
Copy link
Contributor

thierryH91200 commented Mar 28, 2017

BarChartViewController.swift.zip
YMarkerView.swift.zip
HourValueFormatter.swift.zip

capture d ecran 2017-03-28 a 16 19 25

and add

       ```

       values = ["28800", "32400", "36000", "34000", "30000", "42000", "45000"]
        let  marker = YMarkerView( color: #colorLiteral(red: 0, green: 0, blue: 0, alpha: 1), 
                                  font:      NSUIFont.systemFont(ofSize: 12.0),
                                    textColor: NSUIColor.white,
                                    insets: EdgeInsets(top: 8.0, left: 8.0, bottom: 8.0, right: 8.0),
                                    yAxisValueFormatter: HourValueFormatter())

        
        marker.minimumSize = CGSize(width: CGFloat(80.0), height: CGFloat(40.0))
        barChartView.marker = marker





@gsolanki1509
Copy link
Author

Thanks man for your solution. :)

I could show the values now. But still in marker there is unwanted value like (Y:) which i want to remove it. That was one of the reason i was looking for function before showing marker.

screen shot 2017-03-29 at 9 29 56 am

As you can see i want to remove "y" from marker view. Just selected bar value.

@thierryH91200
Copy link
Contributor

look at YMarkerView

Make a little effort please
it's not complicated

@gsolanki1509
Copy link
Author

Gotcha... Sorry to post that issue. :)

@liuxuan30
Copy link
Member

guess we can close this

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

3 participants