The Sanity engineering blog is live. Deep dives from our engineers.

Document chart

Studio v2
This plugin only works with an older version of Sanity Studio (v2), which is deprecated.

Display a chart giving you a rough count of your various document types.

v2 install command (deprecated)

sanity install dashboard-widget-document-chart

Sanity Dashboard Widget: Document Chart

A widget for the Sanity Content Studio Dashboard which displays a barchart giving a count of your doument types

Disclaimer: This widget is intended as proof of concept/example for building your own Sanity dashboard plugins. It's so feature-incomplete that there are more empty checkboxes on this repo than there are neurons in a cephalopd brain 🦑

Usage

cd <my-studio-folder>
sanity install dashboard-widget-document-chart

Then add something like to your dashboardConfig.js file

{
  name: 'document-chart',
  options: {types: ['post', 'author', 'sanity.imageAsset']},
  layout: {width: 'full'}
}

Swap those types for whichever types you have in your Studio, and want to render in this chart.

There's more on how to configure your dashboard at https://www.sanity.io/docs/dashboard#how-to-configure-the-dashboard-5c1617e3633d

Related contributions