Questions tagged [vega-lite]

Vega-Lite is a high-level grammar of interactive graphics. It provides a concise JSON syntax for rapidly generating visualizations to support analysis. Vega-Lite specifications can be compiled to Vega specifications.

Documentation: https://vega.github.io/vega-lite/

Bug Report: https://github.com/vega/vega-lite/issues

Community Mailing List: https://groups.google.com/forum/#!forum/vega-js

1224 questions
5
votes
1 answer

How do I add a secondary Y axis to my vega-lite chart?

This question shows a way to add multiple time series to a vega-lite chart: How to plot several variables on an axis with Vega-Lite? Is there a way to put the second series on the secondary Y axis? I'm talking about putting another Y axis on the…
Ashley Davis
  • 9,896
  • 7
  • 69
  • 87
5
votes
1 answer

vega-lite: multiple marks in a single charts

I am currently assessing what type of js chart engine I should use for out of the box charts, and vega-lite has stood out as pretty simple and flexible at the same time. However, I am wondering whether it is possible to have more than one type of…
jmrosal
  • 191
  • 2
  • 10
5
votes
1 answer

How do I change color of a bar in Vega-lite Bar Chart?

I want to change the default blue color of a bar in a Vega-Lite bar chart. How can I do it? I am posting the json specification below: { "data": { "values": [ {"a":"A", "b":28}, {"a":"B", "b":55}, {"a":"C", "b":43}, {"a":"D", "b":91},…
JVM
  • 946
  • 1
  • 10
  • 23
4
votes
2 answers

Vega-lite rolling averages within groups

I have a table of data that summarizes prices vs. number of users. When I want to display the scatter plot overlaid with a moving average line I use the following Julia function: function log_scatter(df::DataFrame; smooth=2, title="Price by Number…
leei
  • 139
  • 5
4
votes
1 answer

vega lite Infinite extent for field "field_start": [Infinity, -Infinity]

I have code for stacked bar chart, got from Using Vega Lite to display already-aggregated data it works in vega editor { "data": { "values": [ {"bin": "[-inf,8.0)", "bad_distr": 0.009210526315789473, "good_distr": 0.07763157894736843}, …
hanzgs
  • 1,498
  • 17
  • 44
4
votes
1 answer

Vega-lite: Legend label expression to include value of multiple fields

My code is as follows; { "$schema": "https://vega.github.io/schema/vega-lite/v5.json", "width": 800, "height": 200, "data": { "values": [ { "pre_120": 0, "pre_90": 0, …
nifeco
  • 211
  • 1
  • 8
4
votes
2 answers

Python Altair Generate a table on selection

I have a histogram with a bunch of binned data and I was wondering if it would be possible to say generate a table if I select a bar from the histogram and it would display the data as it is in the original dataframe.
GrieferDen
  • 53
  • 6
4
votes
1 answer

How to bind a slider to a parameter so that the slider allows the choice between values in a data column?

Suppose I have a column of data in Vega Lite, like a here, but larger: with 50 to 80 rows. { "data": { "values": [ {"a": "3.33"}, {"a": "3.36"}, {"a": "3.39"}, {"a": "3.42"}, {"a": "3.45"}, {"a": "3.48"}, {"a": "3.51"}, {"a":…
user2373145
  • 332
  • 2
  • 14
4
votes
1 answer

Altair: Separate the color schemes in concatenated charts

For the example below I want to use green color scheme for exports and red for imports. When I separately create the charts everything is good, they get the color scheme I assign them. However, when I concat the charts both of them get the red…
viydanofyi
  • 39
  • 5
4
votes
2 answers

Adding Axis padding/inner margin to Vega-Lite chart

I have a created a vega-lite scatterplot chart. The data for this chart will always be positive, however it is often zero. In this application, it would be helpful for the user for points who's x or y are zero to not overlap with the lines for the…
Ronnoceel
  • 70
  • 4
4
votes
2 answers

How to combine text and a field value in a single line of display

I am using Vega and I am stuck on this simple issue. I want to display The yield is 43.67% However using the samples provided I have managed to just display the value 43.67 { mark: { type: "text", align: "center", fontSize:…
NotAgain
  • 1,927
  • 3
  • 26
  • 42
4
votes
1 answer

How can I rename legend labels in Vega Lite?

I've been trying for the last few days to rename the legend labels on my vega-lite chart. Normally these labels match their respective data field names. I have a case where I'd like to give them a more descriptive name, but without renaming the…
4
votes
1 answer

Vega-lite: Line break or word wrap for labels in axis

I was trying to wrap the labels of x-axis on next line as the labels length is quite long. So is there any way to achieve it. I tried using calculate and labelExpr by breaking the label string and then concatenating them using '\n' but that doesn't…
wahab memon
  • 2,193
  • 2
  • 10
  • 23
4
votes
1 answer

Recommended way to move headers to the bottom of subplots for grouped bar charts

I am trying to make a chart like the following in VL/Altair: In this example, the X axis labels function like VL headers as far as I can tell. In VL/Altair, the headers are automatically set to the top of each subplot (e.g., this chart). What is…
campo
  • 624
  • 5
  • 15
4
votes
1 answer

Altair choropleth map, color highlight based on line chart selection

I am plotting a choropleth map colored by the field Passenger_0_ and a line chart showing the evolution of Passenger_0_ throughout a day by zone. I would like to select a line (zone) in the line chart and have it highlighted in the map and vice…
1 2
3
81 82