Creating Visualizations

Creating Visualizations

⚠️ Deprecated — three-tab editor. The three-tab Chart / Data Mapping / Display Options editor described on this page has been replaced by a visual Plotly chart editor that stores its output as a single JSON column called viz_spec. The content below remains for reference on existing assets created under the legacy model. For new visualization assets, use the current editor and refer to Visualization Spec Reference for the schema, column-reference convention, and validation rules.

The legacy viz_chart_type / viz_dep_var_col_name / viz_indep_var_col_name / etc. columns still exist on the asset record and are returned by the API for read access — integrations that read those fields don't break — but they are no longer used for visualization rendering. Only viz_spec drives the renderer.

Visualization assets return chart-ready data rendered as a static image (SVG/PNG). Unlike Calculation assets which run SQL, Visualization assets are configured through a visual editor — you select a table, map columns to chart axes/values, and tune display options without writing any queries.

External API connections do not support Visualization assets. Use a standard database connection (BigQuery, Snowflake, Redshift, etc.) for visualizations.


Three-Tab Configuration UI

The visualization editor has three tabs that unlock progressively:

TabWhat You ConfigureUnlocks When
ChartData source (schema.table) and chart typeAlways available
Data MappingWhich columns map to which chart axesAfter a table is selected
Display OptionsAggregation, sorting, limits, colors, togglesAfter a chart type is selected

Tab 1 — Chart

Data Source

Select the database schema and table that contains your data. Spartera loads all available schemas from your connected database and lets you drill down to the specific table.

Format: schema_name.table_name

Chart Type

TypeBest For
BARComparing values across categories (products, regions, departments)
LINEShowing trends over time (revenue by month, users over time)
PIEShowing proportions of a whole (market share, budget allocation)
DOUGHNUTSame as Pie, with a hollow center — cleaner for dashboards
SCATTERRevealing correlations between two numeric variables

Tab 2 — Data Mapping

Each chart type requires different column mappings. Spartera filters available columns by data type so you only see compatible options for each axis.

BAR

AxisFieldAccepted Types
ValueHeight of each barAny (numeric recommended)
CategoryThe groups being comparedAny

Best for: "Show me revenue by product category" or "Orders per region."

LINE

AxisFieldAccepted Types
Value (Y-Axis)The metric being trackedNUMERIC only (INTEGER, FLOAT, DECIMAL, etc.)
Time Series (X-Axis)The time dimensionDATE, DATETIME, TIMESTAMP only

Best for: "Show me monthly churn rate over the past year."

PIE / DOUGHNUT

AxisFieldAccepted Types
Value (Size)Determines how large each slice isNUMERIC only
Labels (Categories)Names for each sliceTEXT only (STRING, VARCHAR, CHAR)

Best for: "Show me market share by competitor" or "Revenue split by product line."

SCATTER

AxisFieldAccepted Types
Y-Axis ValueVertical position of each pointNUMERIC only
X-Axis ValueHorizontal position of each pointNUMERIC only
Point Size (optional)Size of each data pointNUMERIC only

Best for: "Show me the relationship between ad spend and revenue" or "Customer age vs. lifetime value."

Field Type Reference

CategoryAccepted SQL Types
NUMERICINTEGER, FLOAT, NUMERIC, NUMBER, DECIMAL, REAL, DOUBLE
DATEDATE, DATETIME, TIMESTAMP
TEXTSTRING, VARCHAR, CHAR, TEXT

Tab 3 — Display Options

Data Transformation

Data Aggregation

Controls how multiple data points are combined into a single value per category or time period.

OptionDescriptionWhen to Use
NoneShows raw data rowsWhen your data is already pre-aggregated
SumAdds all values togetherTotal revenue per region
AverageMean of all valuesAverage order value per month
CountNumber of recordsOrders per category
MinimumLowest valueCheapest product per category
MaximumHighest valuePeak traffic per day

Sort Direction

OptionResult
No SortingData appears in source order
AscendingSmallest to largest (A→Z, 1→10)
DescendingLargest to smallest (Z→A, 10→1)

Descending + Category Limit is a common combination for "Top N" charts.

Category Limit

Limits how many data points are displayed. Set to 0 to show all data.

Chart TypeWhat the Limit Controls
BARMax number of bars
PIE / DOUGHNUTMax number of slices
LINEMax number of data points
SCATTERMax number of points

Use with Filter Direction to specify whether the limit shows the top N or bottom N items.

Filter Direction

OptionResult
Top NShow the N highest values
Bottom NShow the N lowest values

Example: Category Limit = 10, Filter Direction = Top N → shows the 10 highest-value items.


Appearance

Color Scheme — Choose from a set of curated palettes. Applied consistently across all data series in the chart.

ValueDescription
DefaultSpartera default palette
SequentialSingle-hue gradient, best for ordered data (low → high)
DivergingTwo-hue gradient from a midpoint, best for above/below comparisons
CategoricalDistinct colors for unrelated categories
MonochromeSingle color in varying shades
PastelSofter, lighter tones
DarkHigh-contrast dark palette
LightSubtle light palette

Show Legend (default: on) — Displays a key identifying each data series. Recommended for charts with multiple categories.

Show Grid Lines (default: on) — Adds horizontal and vertical reference lines to make it easier to read values from axes.


Chart-Specific Options

LINE and SCATTER

Show Trendline — Overlays a linear regression line showing the overall direction of the data. Helps identify whether values are generally increasing, decreasing, or flat.

Smooth Lines (LINE only) — Uses spline interpolation to create curved lines instead of sharp angles between data points. Makes the chart look more polished, but can obscure sudden changes in the data.

BAR

Stacked Bars — Stacks multiple data series vertically instead of side-by-side. Best for showing part-to-whole relationships and cumulative totals across categories.


Configuration Summary

As you configure your visualization, a summary chip bar appears at the top of the editor showing your current selections — chart type, table, column mappings, and active display options. Clicking any chip jumps you directly to that setting.


Example Configurations

Monthly Revenue Trend

SettingValue
Chart TypeLINE
Tableanalytics.monthly_sales
Y-Axis (Value)revenue_usd
X-Axis (Time Series)month_date
AggregationSum
SortAscending
Smooth LinesOn
Show TrendlineOn

Top 10 Products by Sales

SettingValue
Chart TypeBAR
Tablesales.product_summary
Valuetotal_sales
Categoryproduct_name
AggregationSum
SortDescending
Category Limit10
Filter DirectionTop N

Market Share by Region

SettingValue
Chart TypePIE
Tablemarket.regional_revenue
Value (Size)revenue_usd
Labels (Categories)region_name
AggregationSum
Category Limit8
Filter DirectionTop N

Customer Age vs. Lifetime Value

SettingValue
Chart TypeSCATTER
Tablecustomers.lifetime_metrics
Y-Axislifetime_value_usd
X-Axisage_at_signup
Point Sizetotal_orders
Show TrendlineOn

Tips

Always check your aggregation setting. If your source table has one row per transaction and you're charting by month, you almost certainly need Sum or Average aggregation — otherwise each month shows only one data point.

Use Category Limit + Descending for "Top N" insights. This is the most common pattern for marketplace visualizations — buyers want to see the leaders, not every row.

Pie charts work best with 5–8 slices. More than 8 slices makes them hard to read. Use Category Limit to cap them.

Smooth Lines can hide volatility. If your data has meaningful spikes (stock prices, traffic anomalies), keep Smooth Lines off so the raw shape is visible.

Scatter plots require clean numeric data. Nulls and non-numeric values in either axis field will cause points to be dropped. Clean your data upstream before building scatter visualizations.


Related Pages