Skip to content

Conversation

@sergkop
Copy link
Collaborator

@sergkop sergkop commented Dec 17, 2019

I also faced the bug #1144 - rangeBar doesn't correctly process fillColor from data items. It happens because of the for loop

for (let ii = 0; ii < itemsLen; ii++) {

that results in a strange iteration sequence:

  • The loop with j variable goes over all series items
  • The first time a new x label is encountered all items with this label (srt) are processed in the ii loop. That's when each of them is rendered using the same j value and corresponding fillColor.
  • For j corresponding to repeating labels the loop breaks at line 131 and no rendered items are indexed with it.

I've removed the ii loop, so that items are rendered directly in the j loop. It seems correct, but can possibly break compatibility with other scenarios (the tests were randomly failing for me).

Fixes #1144

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@junedchhipa junedchhipa merged commit dafbbff into apexcharts:master Dec 18, 2019
junedchhipa added a commit that referenced this pull request Dec 18, 2019
@sergkop sergkop mentioned this pull request Dec 18, 2019
7 tasks
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

Successfully merging this pull request may close these issues.

Advanced timeline chart does not work as expected

2 participants