How to get widget for custom variable value or segment?

Hi, all.
Solution I am working on requires displaying reports per custom variable value. Widgets contain custom variable widget, where user can check all custom variable values, click on them to see their graph, or to compare two custom variable values. Custom variable can display all

My questions are next.
Is it possible to get widget for only one custom variable value? If not, is it possible to get similar report as widget like segmentation report visible in Visitors overview?

Yes you can add to the Widget URL either:

  1. Segmentation parameter: Segmentation: API Reference - Matomo Analytics (formerly Piwik Analytics) - Developer Docs - v3

  2. parameter like “label” or filter_pattern see Reporting API Reference: API Reference - Matomo Analytics (formerly Piwik Analytics) - Developer Docs - v3

Matt, thanks for your answer.

I am still unable to display segment as widget. Can you write me full example how to this?