# Barchart Legend Colors Swapped

**URL:** https://meta.discourse.org/t/barchart-legend-colors-swapped/116758
**Category:** Bug
**Created:** [5월 3, 2019, 1:29오후 UTC](https://meta.discourse.org/t/barchart-legend-colors-swapped/116758 "2019-05-03T13:29:00Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![John\_Lehmann](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/john_lehmann/32/140084_2.png) [@John\_Lehmann](https://meta.discourse.org/u/John_Lehmann)
#### Post date: [5월 3, 2019, 1:29오후 UTC](https://meta.discourse.org/t/barchart-legend-colors-swapped/116758/1 "2019-05-03T13:29:01Z")

</div>

Under _admin \> dashboard \> consolidated page views_, it looks to me like the legend colors are swapped. Clearly lighter color blue is the largest value in the chart, yet the numbers for it in the legend are smaller than the dark blue.

 ![image](https://global.discourse-cdn.com/meta/original/3X/2/2/22a05c7f20e0348858eb88f6650caf7c7638866f.png)

---

<div class="post-metadata">

### Author: ![j.jaffeux](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/j.jaffeux/32/60297_2.png) [@j.jaffeux](https://meta.discourse.org/u/j.jaffeux)
#### Post date: [5월 3, 2019, 1:30오후 UTC](https://meta.discourse.org/t/barchart-legend-colors-swapped/116758/2 "2019-05-03T13:30:38Z")

</div>

Indeed this is weird, do you have the same results with safe-mode ? no repro here.

---

<div class="post-metadata">

### Author: ![John\_Lehmann](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/john_lehmann/32/140084_2.png) [@John\_Lehmann](https://meta.discourse.org/u/John_Lehmann)
#### Post date: [5월 3, 2019, 1:36오후 UTC](https://meta.discourse.org/t/barchart-legend-colors-swapped/116758/3 "2019-05-03T13:36:52Z")

</div>

In safe-mode, it looks correct. Since I haven’t added any plugins, I suspect this is a bug with respect to the stock Dark Theme.

---

<div class="post-metadata">

### Author: ![j.jaffeux](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/j.jaffeux/32/60297_2.png) [@j.jaffeux](https://meta.discourse.org/u/j.jaffeux)
#### Post date: [5월 3, 2019, 2:05오후 UTC](https://meta.discourse.org/t/barchart-legend-colors-swapped/116758/4 "2019-05-03T14:05:08Z")

</div>

Indeed seems that’s it. Did you change to dark theme recently ?

---

<div class="post-metadata">

### Author: ![John\_Lehmann](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/john_lehmann/32/140084_2.png) [@John\_Lehmann](https://meta.discourse.org/u/John_Lehmann)
#### Post date: [5월 3, 2019, 2:13오후 UTC](https://meta.discourse.org/t/barchart-legend-colors-swapped/116758/5 "2019-05-03T14:13:11Z")

</div>

I started using and administering discourse recently. 🙂

---

<div class="post-metadata">

### Author: ![traceymoko](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/traceymoko/32/483235_2.png) [@traceymoko](https://meta.discourse.org/u/traceymoko)
#### Post date: [5월 4, 2019, 12:08오전 UTC](https://meta.discourse.org/t/barchart-legend-colors-swapped/116758/6 "2019-05-04T00:08:03Z")

</div>

I noticed this too, just tried again to isolate the problem.

I think the bar chart seems to use the colour scheme of the default theme - when I change my theme in my profile to something else other than the default theme on my site, the bar chart colours seem to remain the same.

---

<div class="post-metadata">

### Author: ![j.jaffeux](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/j.jaffeux/32/60297_2.png) [@j.jaffeux](https://meta.discourse.org/u/j.jaffeux)
#### Post date: [5월 4, 2019, 10:07오전 UTC](https://meta.discourse.org/t/barchart-legend-colors-swapped/116758/7 "2019-05-04T10:07:33Z")

</div>

Yes I expect it to be cache related. Will dig more next week.

---

<div class="post-metadata">

### Author: ![j.jaffeux](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/j.jaffeux/32/60297_2.png) [@j.jaffeux](https://meta.discourse.org/u/j.jaffeux)
#### Post date: [5월 7, 2019, 1:26오후 UTC](https://meta.discourse.org/t/barchart-legend-colors-swapped/116758/9 "2019-05-07T13:26:10Z")

</div>

So it was not what I thought 😅

The fix is kind of simple:  
[https://github.com/discourse/discourse/pull/7495](https://github.com/discourse/discourse/pull/7495)

Long story short: by a combination of transparency and dark background and RNG, the color looked inverted on dark background when they were in fact correct. So I have removed transparency in this case and added a way to “lighten” colors.

 ![34](https://global.discourse-cdn.com/meta/original/3X/5/e/5e53553571f979b2a63cc1d699c203391ef86259.png)

---

<div class="post-metadata">

### Author: ![j.jaffeux](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/j.jaffeux/32/60297_2.png) [@j.jaffeux](https://meta.discourse.org/u/j.jaffeux)
#### Post date: [5월 7, 2019, 4:13오후 UTC](https://meta.discourse.org/t/barchart-legend-colors-swapped/116758/10 "2019-05-07T16:13:40Z")

</div>


