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
6
votes
1 answer

How to color lines with specific colors in Vega-Lite?

VegaLite assigns colors automatically. The Gold prices are Blue, and Silver prices are Orange, which feels wrong. How can I assign explicit colours - #F1C40F for Gold and #95A5A6 for Silver? I also would like to keep the data.values as in the…
Alex Craft
  • 13,598
  • 11
  • 69
  • 133
6
votes
1 answer

Format labels on bar charts in Altair

[![chart showing numbers without correct formatting][1]][1] I need to format the label on these bars, so that they are rounded to nearest whole number. I have the following code: def chart_tender_response_times(dataframe=None): chart = ( …
woodbine
  • 553
  • 6
  • 26
6
votes
1 answer

Drawing line plot for a histogram

I'm trying to reproduce this chart using Altair as much as I can. https://fivethirtyeight.com/wp-content/uploads/2014/04/hickey-bechdel-11.png?w=575 I'm stuck at getting the black line dividing pass/fail. This is similar to this Altair example:…
6
votes
1 answer

How can I put a line break in a Vega-lite axis title?

I'm new to Vega-lite and I'm trying to figure out if line breaks are possible in axis titles. I have a long axis titles, e.g.: "Long axis title is too long to fit under the graph" I've tried: "Long axis title is too\n long to fit under the graph"…
Thomas Stow
  • 108
  • 1
  • 6
6
votes
3 answers

How to sort Y-axis labels different for each row in my plot?

I want each subplot to sort the labels based on the value defining the size of the bar. See example image: data = {'label': ['A','A','B','B'], 'variable': ['x', 'y', 'x', 'y'], 'value':[2,4,3,1]} df = pd.DataFrame.from_dict(data) selector =…
Bart
  • 63
  • 6
6
votes
1 answer

Generating 3D surface plots with Vega?

A current project requires us to use Vega Visualization Grammar wherever possible and otherwise fall back to D3.js. 3D-surface plots are not part of the Vega's gallery of examples, however Vega Documentation makes me optimistic that we could…
B--rian
  • 5,578
  • 10
  • 38
  • 89
5
votes
2 answers

How to make the jitter by using vegalite package

I got the following graph for each job title with salary in box plot: so there are some outliers here, presented as dot, I want to make some jitters like this for each job title have outliers: Is there any way I can do it with Vegalite…
hahaha
  • 183
  • 5
5
votes
1 answer

Changing overlap order of a line chart in altair

I generate a line chart in Altair. I'd like to control which lines are "on top" of the stack of lines. In my example here, I wish for the red line to be on top (newest date) and then descend down to the yellow (oldest date) to be on the…
user3556757
  • 3,469
  • 4
  • 30
  • 70
5
votes
1 answer

Altair chart: Show less lines in the grid

I'm working on a chart using Altair, and I'm trying to figure out how to have less lines in the background grid. Is there a term for that background grid? Here's a chart that looks like mine, that I took from the tutorial: Let's say that I want to…
Ram Rachum
  • 84,019
  • 84
  • 236
  • 374
5
votes
1 answer

Vega-lite: How do you customize legend labels?

I have this bar chart that's made with Vega-lite (code and pic below). But I want to customize the legend labels so that instead of videoGame it's Video Game and instead of tv its TV. Is there anyway to do this? lineChart = vegalite ({ "$schema":…
NewToJS
  • 2,011
  • 4
  • 35
  • 62
5
votes
3 answers

Sankey Diagram (Alluvial Diagram) in Vega-lite

Anyone having an idea on how to create Sankey diagrams like those in Vega-lite? https://observablehq.com/@d3/sankey-diagram Input would be data like From | To | Amount
Christian
  • 372
  • 3
  • 13
5
votes
1 answer

Groupby aggregations and missing combinations of values

I recently started tinkering with Vega-Lite templates to make a confusion matrix for an open-source data science software called DVC. You can see the template in my PR here, but I'll also repeat a simplified version below: { ... "data": { …
5
votes
1 answer

Disable tooltip labels being truncated/increasing tooltip character limit when using vega-lite

Im creating a visualization in kibana using vega-lite, but I suppose this applies anywhere. Is there a way in vega-lite to disable, or at least increase the character length of the tooltip so that it is not truncated? I can't find any documentation…
dasherzx
  • 81
  • 1
  • 3
5
votes
1 answer

Vega-Lite - What is the best way to work with large amounts of data?

I'm using Vega-Lite to visualize a large amount of data in a JSON format. I have ~16,000 data items in the data section. I'm placing both the data and the graph code in a single JSON (~20,000 lines) in the Vega online editor. The problem is that…
5
votes
2 answers

What's the proper way to implement a custom click handler in vega-lite

I don't seem to be able to figure this out by reading the docs. Is there a way to implement a onClick event handler for any of my marks?
loxs
  • 1,476
  • 1
  • 12
  • 27
1
2
3
81 82