You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Created a LineChart with a LineChartDataSet, set the dataset form property to .none to keep it from displaying in the legend. Used the colors[] array to change the colors.
What did you expect to happen?
The dataset entries to neither appear nor take up space in the legend.
What happened instead?
Every color added to the .colors array used space in the legend, even spilling over to the next line. If the label for the dataset is provided, sometimes it renders it and sometimes not, depending on if it spilled over to the next line.
Charts Environment
Charts version/Branch/Commit Number: 3.1.1 Xcode version: Version 10.1 (10B61) Swift version: Swift 4.2 Platform(s) running Charts: iOS 10.3 10.13.6 (17G65) macOS version running Xcode:
Demo Project
I don't have a demo project, but I think the bug is in LegendRenderer.swift, in the renderLegend() at line 398. Even though it doesn't render the form or the label, it increments posX by 3 (stack space) for every value in colors[]. I think it would be sufficient to not increment posX in this case, although I don't know if that would break anything else. I did test a change where I filtered out legend entries that had form of .none and label == nil, but that could break other things.
The text was updated successfully, but these errors were encountered:
What did you do?
Created a LineChart with a LineChartDataSet, set the dataset form property to .none to keep it from displaying in the legend. Used the colors[] array to change the colors.
What did you expect to happen?
The dataset entries to neither appear nor take up space in the legend.
What happened instead?
Every color added to the .colors array used space in the legend, even spilling over to the next line. If the label for the dataset is provided, sometimes it renders it and sometimes not, depending on if it spilled over to the next line.
Charts Environment
Charts version/Branch/Commit Number: 3.1.1
Xcode version: Version 10.1 (10B61)
Swift version: Swift 4.2
Platform(s) running Charts: iOS 10.3 10.13.6 (17G65)
macOS version running Xcode:
Demo Project
I don't have a demo project, but I think the bug is in LegendRenderer.swift, in the renderLegend() at line 398. Even though it doesn't render the form or the label, it increments posX by 3 (stack space) for every value in colors[]. I think it would be sufficient to not increment posX in this case, although I don't know if that would break anything else. I did test a change where I filtered out legend entries that had form of .none and label == nil, but that could break other things.
The text was updated successfully, but these errors were encountered: