Interactive Guide
Memberstack
+

Charts from Data Tables

Turn your Memberstack Data Tables into beautiful, interactive visualizations. No coding experience required.

9 Chart Types

Bar, Line, Pie & More

No Code

Just HTML Attributes

Real-time

Auto Updates

Visualize Your Data Tables

Create charts and graphs from data stored in your Memberstack Data Tables. Display member data as colorful, interactive visualizations instead of boring tables.

Spending by category

Progress over time

Sales comparison

Completion rates

Phase 1

Quick Start Setup

1

Add Required Scripts

Add these to your page, ideally in the <head> or just before </body>:

HTML
<!-- Memberstack (you probably already have this) -->
<script data-memberstack-app="YOUR_APP_ID"
  src="https://static.memberstack.com/scripts/v1/memberstack.js">
</script>

<!-- Chart.js - the charting library -->
<script src="https://cdn.jsdelivr.net/npm/chart.js@4/dist/chart.umd.min.js">
</script>

<!-- MemberScript #213 -->
<script src="memberscript213.js"></script>
2

Add a Chart to Your Page

Add this HTML where you want your chart to appear:

HTML
<div data-ms-code="analytics-chart"
     data-ms-code-table="your_table_name"
     data-ms-code-chart-type="bar"
     data-ms-code-label-field="name"
     data-ms-code-value-field="amount">
  <h3 data-ms-code="analytics-title">My Chart</h3>
  <div data-ms-code="analytics-loading">Loading...</div>
  <div data-ms-code="analytics-error" style="display:none;">
    Could not load data.
  </div>
  <canvas data-ms-code="analytics-canvas"></canvas>
</div>
3

Configure Your Data Table

Your Data Table must allow client-side reading:

  1. Go to your Memberstack Dashboard
  2. Click Data Tables in the sidebar
  3. Select your table (e.g., "orders", "workouts")
  4. Find Permissions settings
  5. Enable "Allow read (Public or Any Member)"

Without this, the chart will show an error instead of your data.

Phase 2

Chart Types

MemberScript #213 supports 9 different chart types. Click any chart below to see an interactive demo where you can edit the data and watch the chart update in real-time.

Bar Chart

Edit the data below to see the bar chart update instantly

Data Table

LabelValue

Click on labels to edit. Changes update the chart instantly.

Live Preview

Code for Bar Chart

HTML
<div data-ms-code="analytics-chart"
     data-ms-code-table="your_table"
     data-ms-code-chart-type="bar"
     data-ms-code-chart-name="Bar Chart"
     data-ms-code-label-field="name"
     data-ms-code-value-field="amount">
  <h3 data-ms-code="analytics-title"></h3>
  <div data-ms-code="analytics-loading">Loading...</div>
  <div data-ms-code="analytics-error" style="display:none;">Error</div>
  <canvas data-ms-code="analytics-canvas"></canvas>
</div>

Phase 3

Attributes Reference

Description
Attribute

Your Data Table's name (must match exactly)

Required

Chart type: bar, line, pie, doughnut, polarArea, radar, bubble, scatter

Required

Title displayed above the chart

Optional

Column containing names/labels for data points

Usually required

Column containing numbers to visualize

Usually required

Grouping & Filtering

Group rows by this column (creates one data point per unique value)

Optional

How to combine values: "sum" (add numbers) or "count" (count rows)

Optional

Only show current member's records (specify member ID column)

Optional

Maximum records to fetch (default 100)

Optional

Styling

Custom color palette (comma-separated hex colors)

Optional

Bar direction: "vertical" (default) or "horizontal"

Optional

Bubble & Scatter Charts

Column for X-axis (horizontal) values (numbers only)

Optional

Column for Y-axis (vertical) values (numbers only)

Optional

(Bubble only) Column for bubble size (numbers only)

Optional

Phase 4

HTML Element Roles

Add elements with these data-ms-code values inside your chart container. The script finds and uses them automatically.

Purpose
Role Value

Main container — put all config attributes here

analytics-chart<div>

Shows the chart name from data-ms-code-chart-name

analytics-titleany

Where the chart is drawn (auto-created if missing)

analytics-canvas<canvas>

Shown while data loads, hidden when ready

analytics-loadingany

Shown if data fails to load

analytics-errorany

FAQ

Common Questions

Common Questions

Everything you need to know about charts

Add the data-ms-code-owner-field attribute with the column name that stores the member ID. For example: data-ms-code-owner-field="member_id". The chart will automatically filter to show only records where that column matches the logged-in member's ID.

Use data-ms-code-value-agg="count" along with the group attribute. For example: data-ms-code-group="status" and data-ms-code-value-agg="count". This counts how many records exist for each unique value in the group column.

Yes! Each chart is independent. Just make sure each has its own container with data-ms-code="analytics-chart". You can have as many charts as you need, each with different configurations.

Check these common issues: 1) Ensure your Data Table allows client-side reading in Memberstack settings. 2) Verify your table name matches exactly (it's case-sensitive). 3) Make sure column names in your attributes match your table's columns. 4) Open browser console (F12) to check for JavaScript errors.

In your CSS, override the variable: :root { --ms213-chart-height: 500; } (pixels). Or you can set a specific height on the canvas wrapper element in your HTML directly.

This means permission is denied and your Data Table doesn't allow client-side access. Go to Memberstack Dashboard → Data Tables → Select your table → Enable "Allow read from client" or similar setting in the permissions section.

Yes! Use the data-ms-code-colors attribute with comma-separated hex colors. For example: data-ms-code-colors="#4353FF,#10B981,#F59E0B". You can also use CSS variables in the memberscript213.css file.

Call the refresh method via JavaScript: if (window.ms213Charts) { window.ms213Charts.refresh(); }. This will re-fetch data from your Data Table and update all charts on the page.

Troubleshooting

Chart shows nothing: Enable client-side read in Data Table permissions
403 Forbidden error: Data Table doesn't allow browser access
Wrong data displayed: Check column names match exactly (case-sensitive)
polararea not working: Use polarArea (capital A)

Refreshing Charts

After adding new data to your table, refresh all charts with JavaScript:

JavaScript
if (window.ms213Charts) {
  window.ms213Charts.refresh();
}

Try Memberstack for free

100% free, unlimited trial — upgrade only when you're ready to launch. No credit card required.