microcharts-dotnet / Microcharts

Create cross-platform (Xamarin, Windows, ...) simple charts.
MIT License
2.03k stars 360 forks source link

[Bug] Label color in Donutchart remains same. It should change based on the Entry color. #239

Open ansariTanveer opened 3 years ago

ansariTanveer commented 3 years ago

Describe the bug When I use Donutchart with 5 Entry having different color in all of them. The Donutchart renders correct. However, the label-color for all 5 Entry remains same which is "black". The label-color should be changed to the color provided in Entry.

Which platform and version is this for?

  1. Android

To Reproduce Steps to reproduce the behavior:

  1. Install nuget package "Microcharts.Forms" version "0.9.5.9".
  2. Write code to display Donutchart with multiple Entry.
  3. Each Entry should have different color.

Expected behavior The labels in Donutchart should display different color.

Screenshots Screenshot_20210203-221938

Labels inside red box (image uploaded).

Seuleuzeuh commented 3 years ago

It's fixed in the next version (Main branch).

Magendanz commented 3 years ago

I've been seeing this for a while now too. Until the new release comes out with the fix, what version should we roll back to?

YuriMB commented 3 years ago

I've been seeing this for a while now too. Until the new release comes out with the fix, what version should we roll back to?

I'm experiencing a similar issue. The labels are black for a bar chart. I suppose the root cause is the same. The last known version that previously worked (and the one I rolled back to for now) is 0.8.5-pre.

TJFlynn commented 3 years ago

I had the same problem with a donut chart in version "0.9.5.9". The chart colors were fine, but all the labels were black. My work around was to set the ValueLabelColor when building the chart entry to the same color as the Color property. That solved the issue. For example : new ChartEntry(Example) { Label = ... ValueLabel = ... Color = SKColor.Parse("#e9967a"), ValueLabelColor = SKColor.Parse("#e9967a") }

hafnerpw commented 2 years ago

I had the same problem with a donut chart in version "0.9.5.9". The chart colors were fine, but all the labels were black. My work around was to set the ValueLabelColor when building the chart entry to the same color as the Color property. That solved the issue. For example : new ChartEntry(Example) { Label = ... ValueLabel = ... Color = SKColor.Parse("#e9967a"), ValueLabelColor = SKColor.Parse("#e9967a") }

Had the same issue. This fixed it, thanks for posting.