Closed accforgithubtest closed 3 weeks ago
Unfortunately, the properties are common to the entire chart component (and not specific per visualisation type). Colors are set as top-level properties, and they are not set per datapoint, but per series.
But nothing prevents you from having a single datapoint per series:
select
'chart' as component,
'treemap' as type,
'Quarterly Results By Region (in k$)' as title,
TRUE as labels,
'yellow' as color, 'purple' as color, 'cyan' as color; -- or jsonb_build_array('yellow', 'purple', 'cyan') if your database supports it
select 1 as series, 'United States' as label, 35 as value;
select 2 as series, 'France' as label, 30 as value;
select 3 as series, 'Germany' as label, 350 as value;
Thanks for the answer, using multiple color specs at the chart component works and I used a order by to ensure the ordering of the series in my results does not change. This works now, and thank you !
Would be nice to be able to specify the colors for each each of the data point in a treemap chart.
Currently this works and applies the color to all data in the chart -
while this does not work while attempting to specify color for each data in the chart -