question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"fill: false" option on dataset causes legend to also not fill

See original GitHub issue

When specifying the fill: false option for items in a dataset, the legend for that data set is also not filled, even if backgroundColor is specified. This is unexpected behavior according to documentation, as the documentation simply says the background of the chart itself will not be filled. As a result, a white hole appears in the legend (if border is also specified).

This issue appears in version 2.9.1 installed via npm. I am running it via an angular project. A week ago, when I first installed the project to work on it, this issue did not exist. However, it appeared today when I ran npm update. This leads me to believe that the issue was introduced in versions 2.91 or 2.9.0, or another commit within the past week or so.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
designosiscommented, Nov 2, 2019

Is there a rationale as to why this would be desired behavior for line graphs?

It’s difficult to rationalize design. My team ran an A-B survey – with an admittedly small and unscreened sample base of 30 – against the two images in #6673. When asked to choose between the two images, 22 preferred solid, 2 preferred hollow, 5 were undecided, and 1 thought they were exactly the same. Our findings were as follows:

  1. The unfilled hollow interrupts the compositional flow and rhythm of a graph. The eye tracks to “arbitrary non-data”, mildly reducing usability.
  2. That in a layout where both solid and line-styled graphs were present, it would be necessary to have both solid and line-styled legends; Otherwise, solid is always preferable.
  3. The results were heavily biased towards working professionals. We were unable to estimate which way the data would skew for those outside our test group. Some of us thought the average user would have a harder time (as unskilled cartographers), others thought the reduced familiarity would also increase indifference to such a minor detail.

To summarize, our conclusion was that the option to select fill-style was desirable.

1reaction
gmonahancommented, Nov 22, 2019

I guess I’m in the minority then as I prefer controlling whether the legend icon is filled or not. Here’s an example why - if you have people with color blindness - you use more variance on the line dash - so if you have 3 grey lines that have a variance in dashing - the icons in the legend are now filled and are hard to distinguish.

  fill: false,
  borderColor: "rgba(255,0,0,1.0)",
  backgroundColor: '#a6cee3',
  borderWidth: 1,

With older version of chartJS, I didn’t need to specify the legend icon backgroundColor - it defaulted to a nice medium grey. With 2.9.3, the background color is ignored in the legend icon. Changing the fill to true yields the right fill color in the legend icon, at the expense of filling under the line.

I’m reverting to 2.8 until this is fixed. We need a way to color both attributes without a single attribute variable.

Read more comments on GitHub >

github_iconTop Results From Across the Web

chart.js - ChartJS do not render any legend if the label is falsy
Now I want to stop ChartJS from rendering the legend which is then shown as "null" or "undefined". Later I am setting a...
Read more >
Controlling legend appearance in ggplot2 with override.aes
The plots itself shows the fill colors and shapes, but you can some issues in the legends. The fill colors don't show up...
Read more >
plotOptions.area.fillColor | highcharts API Reference
This option works if animation is fired on individual points, not on a ... In styled mode, the fill color can be set...
Read more >
Dataset - Concepts - Handbook - Apache ECharts
Dataset. dataset is a component dedicated to manage data. Although you can set the data in series.data for every series, we recommend you...
Read more >
Visualization: Area Chart - Google Developers
It is important to note that the interpolateNulls option does not work with stacked area charts. ... The google.charts.load package name is "corechart"....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found