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

Add labels to marker or create custom marker view #3620

Closed
Bogdan59 opened this issue Sep 4, 2018 · 4 comments
Closed

Add labels to marker or create custom marker view #3620

Bogdan59 opened this issue Sep 4, 2018 · 4 comments

Comments

@Bogdan59
Copy link

Bogdan59 commented Sep 4, 2018

How to create custom marker with labels?
Now I use BalloonMarker, but it does not fit

`open class MarkerView1: BalloonMarker
{
  public override init(color: UIColor, font: UIFont, textColor: UIColor, insets: UIEdgeInsets)
    {
        super.init(color: color, font: font, textColor: textColor, insets: insets)
 }
    
    open override func refreshContent(entry: ChartDataEntry, highlight: Highlight)
    {
  setLabel(String(entry.y))
    }
}`

Want to create
banlgrafff

@thierryH91200
Copy link
Contributor

thierryH91200 commented Sep 4, 2018

try to work with

RectMarker.swift.zip

 let marker = RectMarker(color: #colorLiteral(red: 0.9994240403, green: 0.9855536819, blue: 0, alpha: 1), font: NSFont.systemFont(ofSize: CGFloat(12.0)), insets: NSEdgeInsets(top: 8.0, left: 8.0, bottom: 4.0, right: 4.0))
        marker.chartView = chartView
        marker.minimumSize = CGSize(width: CGFloat(60.0), height: CGFloat(30.0))
        chartView.marker = marker

capture d ecran 2018-09-04 19 07 42

@Bogdan59
Copy link
Author

Bogdan59 commented Sep 5, 2018

thierryH91200 - Thanks a lot, its works!

@noura-rizk
Copy link

After trying multiple solutions, this is the only one that worked for me thanks a lot.!

@DevboiDesigns
Copy link

The date is the example does not work

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

5 participants