Skip to content

Create a documents-per-class plot

A plot reads live data from the vault and draws it. This guide builds the simplest useful one: a bar chart counting documents by class, which answers “what is actually in this vault” without anybody running a search.

The same shape — one series, one group-by property, one aggregate — is behind most plots. Once this one works, changing the property is all it takes to count by workflow state, by owner, or by anything else.

  • CtrlPortals installed and licensed.
  • A dashboard to put the plot on. A dashboard rather than a portal, because this chart is about the vault as a whole rather than about one object.
  • The class property in the vault populated on enough documents to be worth charting.
  1. Create a dashboard and one segment.

    The segment is the container the plot sits in. One segment holding one component is the right starting point; splitting the dashboard up comes later.

  2. Add a Plot View component and choose the chart type.

    Set the component’s type to Plot View, and the plot type to Bars. The plot type decides which series settings appear, so changing it later means revisiting them.

  3. Add a series that queries documents.

    A series is one set of data on the chart. Point it at the document object type and add a condition excluding deleted objects, so the count matches what a user would see.

  4. Set the aggregation and the two axes.

    Group by the class property and aggregate with a count. The label axis is the class, the value axis is the count.

    Give the axes short names. They are referred to again in the next step, and a long name is a long name to mistype.

  5. Choose the properties a user sees when they click a bar.

    Clicking a bar opens the objects behind it in a list. The properties selected here are the columns of that list, so include the ones somebody would need to act on what the chart shows.

  6. Refresh the configuration.

    A plot does not pick up configuration changes until the configuration is refreshed. A chart that has not changed after an edit is almost always this.

Open the dashboard. The bars should add up to the number of documents the same search returns in the M-Files client — if they do not, the series condition is filtering something out.

Click a bar. The list that opens should hold exactly the documents of that class.