{"version":"1.0","type":"rich","title":"Vega-Lite API Stack Sorting Struggle","description":"This visualization shows suicide rates aggregated by year and age group, with bars stacked by age. The color legend uses a custom sort order, but the stacking order of the bars fails to match that order, highlighting a mismatch in the Vega-Lite API. The code uses `vl.aggregate` to sum suicides, `vl.markBar`, and encodes color and order with `fieldO('age')` and a custom `sort` array. Data comes from a CSV loaded via `d3.csv`, and the visualization is rendered using the Vega-Lite API with D3 v5.","provider_name":"VizHub AI Studio","provider_url":"https://vizhub.com","html":"<iframe src=\"https://vizhub.com/viz/59247083c16043208e8e226098d711ef?mode=embed\" width=\"960\" height=\"500\" scrolling=\"no\" frameborder=\"0\"></iframe>","width":960,"height":500,"cache_age":3600}