Updated bar chart example to use new API