Show average of a field across the site with the nodes field sat next to it in a chart

Created on 10 July 2024, 9 months ago
Updated 18 July 2024, 9 months ago

I have hundreds of food products in a directory and want to show average of a specific field, lets say carbs per 100g across all food nodes that have that field data.

I want to create a bar chart and show it on every food product page that shows both the average across the site with the next data point on the chart being that specific nodes carbs per 100g so they can be compared.

How is this possible with charts? Thanks!

πŸ’¬ Support request
Status

Active

Version

5.0

Component

Documentation

Created by

πŸ‡¬πŸ‡§United Kingdom effortDee

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @effortDee
  • πŸ‡ΊπŸ‡ΈUnited States andileco

    @effortDee you could make use of the "Chart Attachment" display and in that display, use aggregation and the average function (make sure you chose "Apply to this Chart Attachment only" when aggregating, adjusting your chart settings, etc. You would attach the Chart Attachment to your block that has the current page's product. Let me know if this gives you direction.

Production build 0.71.5 2024