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

StackedBar Chart highlighting complete single bar #504

Closed
NSri opened this issue Oct 25, 2015 · 4 comments
Closed

StackedBar Chart highlighting complete single bar #504

NSri opened this issue Oct 25, 2015 · 4 comments

Comments

@NSri
Copy link

NSri commented Oct 25, 2015

I am using StackedBar Chart in iOS-Charts, I need to provide two functionality:

  1. When user selects single bar I need to highlight complete Bar instead of specific stack index.
  2. I need to show pop-up with complete value.
    How this can be achieved?

For highlighting I tried doing following but it's not working

let highlighter1: ChartHighlight = ChartHighlight(xIndex: dataSetIndex, dataSetIndex: 0, stackIndex: 0)
let highlighter2: ChartHighlight = ChartHighlight(xIndex: dataSetIndex, dataSetIndex: 0, stackIndex: 1)
let highlighter3: ChartHighlight = ChartHighlight(xIndex: dataSetIndex, dataSetIndex: 0, stackIndex: 2)

chartView.highlightValues([highlighter1, highlighter2, highlighter3])

this doesn't even highlight single bar.

if I give single value it works.

@liuxuan30
Copy link
Member

  1. using -1 for stackIndex will highlight the whole bar, is this what you want?
  2. Take a look at ChartMarker, it can pop up a small HUD to display some text. Just try the ChartsDemo

@NSri
Copy link
Author

NSri commented Oct 26, 2015

Thanks 👍 'ChartMarker' class helped.

@liuxuan30
Copy link
Member

don't forget it can have image as well :)

@hardiiik
Copy link

hardiiik commented Dec 6, 2018

For marker things, ChartMarker is perfect as per @liuxuan30
But to highlight whole stacked bar, you can use this property of BarChartView,
chartView.setHighlightFullBarEnabled = true

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