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.

Support for strokeWidth scale in legend

See original GitHub issue

When trying to encode a field as “strokeWidth” in the editor with vega-lite 3.0.0-rc10, the following error is raised: “Error: Missing valid scale for legend.” Setting “strokeWidth” to a constant value does seem to work.

{
  "$schema": "https://vega.github.io/schema/vega-lite/v3.json",
  "description": "A simple bar chart with embedded data.",
  "data": {
    "values": [
      {"a": "A","b": 28}, {"a": "B","b": 55}, {"a": "C","b": 43}
    ]
  },
  "mark": "square",
  "encoding": {
    "x": {"field": "a", "type": "ordinal"},
    "y": {"field": "b", "type": "quantitative"},
    "strokeWidth": {"field": "b", "type": "quantitative"}
  }
}

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
kanitwcommented, Jan 13, 2019

I think supporting legend for fill/strokeOpacity is lower priority than for strokeWidth.

0reactions
kanitwcommented, Jan 13, 2019

https://github.com/vega/vega-lite/pull/4454 disables legend for fill/strokeOpacity and strokeWidth in Vega-Lite. We can enable them again once we support any of these in Vega.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Support legend strokeWidth · Issue #6641 · vega/vega-lite
Stroke width in Vega expects the scale that should be mapped to the legend. The workaround is to use symbolStrokeWidth .
Read more >
Add legend for stroke points ggplot2 - Stack Overflow
I want to add a legend for the thickness of stroke in the graph. Do you have any idea how can i do...
Read more >
stroke-width - SVG: Scalable Vector Graphics - MDN Web Docs
The stroke-width attribute is a presentation attribute defining the width of the stroke to be applied to the shape.
Read more >
Change the Legend Stroke Size - Kendo UI Chart for jQuery
An example on how to change the size of the legend stroke in the Kendo UI Chart.
Read more >
How to control line width in legend in QGIS?
First, set the feature symbol to use millimetres, not map units · In the composer, add the legend and item for the corresponding...
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