ChartsOrg / ChartsOrg/Charts

When data sets are hidden they should not be highlightable.

Open
#4,884 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Swift
Stars
28k
Forks
6k
PR merge metrics
No merged PRs in 30d

Description

* [x] I've read, understood, and done my best to follow the [*CONTRIBUTING guidelines](https://github.com/jjatie/Charts/blob/master/CONTRIBUTING.md).

## What did you do?

I had a Line chart view with multiple lines/data sets. When a data set (`LineChartDataSet`) is marked not visible (`visible` property), it is still highlightable in the chart.

## What did you expect to happen?

I expected that hiding a data set would disable its ability to be highlighted.
I appreciate that there is a boolean `highlightEnabled` which allows
this to be disabled manually, but I suspect this should also happen if it is hidden.

## What happened instead?

When a dataset is hidden it can still be highlighted.

## Charts Environment

Here is the related code:

https://github.com/danielgindi/Charts/blob/e91ba716190836b013ef8a9ca53e220ad5051e21/Source/Charts/Highlight/ChartHighlighter.swift#L71

This is not dependent on the environment. You can see it's in the current version, it's also in prior versions.

**Charts version/Branch/Commit Number:**
**Xcode version:**
**Swift version:**
**Platform(s) running Charts:** iOS
**macOS version running Xcode:**

## Demo Project

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.