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

color in BalloonMarker is never used #3287

Closed
liuxuan30 opened this issue Feb 22, 2018 · 4 comments
Closed

color in BalloonMarker is never used #3287

liuxuan30 opened this issue Feb 22, 2018 · 4 comments
Assignees

Comments

@liuxuan30
Copy link
Member

got a warning saying if let color = color is never used in BalloonMarker.
I take a look at it and found color is never used as well.
I'm not sure why we have if let color = color and did nothing. Any idea what's the color is supposed to do? @danielgindi @jjatie

@thierryH91200
Copy link
Contributor

thierryH91200 commented Feb 22, 2018

it's the background color
it was a long time

    if let color = color
    {
        context.setFillColor(color.cgColor)
        context.beginPath()
        context.move(to: CGPoint(
            x: rect.origin.x,
            y: rect.origin.y))
        context.addLine(to: CGPoint(
            x: rect.origin.x + rect.size.width,
            y: rect.origin.y))
        context.addLine(to: CGPoint(
            x: rect.origin.x + rect.size.width,
            y: rect.origin.y + rect.size.height - arrowSize.height))
        context.addLine(to: CGPoint(
            x: rect.origin.x + (rect.size.width + arrowSize.width) / 2.0,
            y: rect.origin.y + rect.size.height - arrowSize.height))
        context.addLine(to: CGPoint(
            x: rect.origin.x + rect.size.width / 2.0,
            y: rect.origin.y + rect.size.height))
        context.addLine(to: CGPoint(
            x: rect.origin.x + (rect.size.width - arrowSize.width) / 2.0,
            y: rect.origin.y + rect.size.height - arrowSize.height))
        context.addLine(to: CGPoint(
            x: rect.origin.x,
            y: rect.origin.y + rect.size.height - arrowSize.height))
        context.addLine(to: CGPoint(
            x: rect.origin.x,
            y: rect.origin.y))
        context.fillPath()
    }

@liuxuan30
Copy link
Member Author

liuxuan30 commented Feb 22, 2018

hi @thierryH91200 thanks, may I ask where did you get context.setFillColor(color.cgColor), you write it yourself, or it used to exist in the library, and removed by mistake?

@thierryH91200
Copy link
Contributor

@liuxuan30
Copy link
Member Author

@thierryH91200 you are refering swift demo's. seems we have a big diff between Objc demo's balloon marker and Swift demo's.
Seems we should port the swift one into objc demo.

@liuxuan30 liuxuan30 self-assigned this Feb 23, 2018
FreddyZeng added a commit to FreddyZeng/Charts that referenced this issue Feb 26, 2018
* 'master' of https://github.com/danielgindi/Charts:
  add pie chart unit tests (ChartsOrg#3297)
  ChartsOrg#3287: align Objc and Swift demos balloon marker
  update changelog
  Min and Max reset when clearing ChartDataSet (Fixes ChartsOrg#3260)

# Conflicts:
#	Source/Charts/Mark/BalloonMarker.swift
FreddyZeng added a commit to FreddyZeng/Charts that referenced this issue Mar 14, 2018
* master: (55 commits)
  Refactors -[tableView:cellForRowAtIndexPath:] (ChartsOrg#3326)
  fix ChartsOrg#3311. Need one more key for iOS 11 camera roll saving
  revert a mistake, fix ChartsOrg#3299
  add pie chart unit tests (ChartsOrg#3297)
  ChartsOrg#3287: align Objc and Swift demos balloon marker
  update changelog
  Min and Max reset when clearing ChartDataSet (Fixes ChartsOrg#3260)
  Restored old performance (ChartsOrg#3216)
  Support other bundle than main MarkerView.viewFromXib() (ChartsOrg#3215)
  For ChartsOrg#2840. add dataIndex parameter in `highlightValue()` calls (ChartsOrg#2852)
  Balloon Marker indicates position of data (ChartsOrg#3181)
  bump Info.plist version
  Fixed a duplicated assignment compared with obj-c code. (ChartsOrg#3179)
  Updated README for 3.0.5 (ChartsOrg#3183)
  BubbleChart uses correct colour for index now.
  Added custom text alignment for noData
  Fixes the distance issue between the legend and the horizontal bar chart (Fixes ChartsOrg#2138) (ChartsOrg#2214)
  call setNeedsDisplay() here to trigger render noDataText (ChartsOrg#3198)
  添加定制TY的Mark
  添加修改过的Mark到工程中
  ...

# Conflicts:
#	ICXCharts.podspec
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