ChartsOrg / ChartsOrg/Charts

Crash (Index out of bounds) in case of custom labels which does not match the number of bars/lines in a combined bar chart

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

Description

In case I set the custom labels (e.g. adding a legend for additional horizontal lines) which count does not matches the number of lines and bars in a combined bar chart, my app crashes in the following line 388 in the `LegendRenderer.swift`.

![bildschirmfoto 2017-03-15 um 22 21 17](https://cloud.githubusercontent.com/assets/13385716/23971328/d0d548b0-09cd-11e7-8ddd-47acae9a7b52.png)

The size of `calculatedLabelSizes` does not matches the size of `entries`. Therefore I get a **fatal error: Index out of bounds** within the for loop.

Any ideas why the number of lines and bars have to match the number of entries in a custom legend? Makes no sense for me.

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.