# SmartVisuals Sparklines for Power BI

> Sparkline table and KPI tiles for Power BI: line, area, column, win/loss and bullet sparklines with last value and change on an honest shared scale.

- Page: https://www.smartvisuals.io/visuals/sparklines
- Fields and settings: https://www.smartvisuals.io/visuals/sparklines/settings
- Microsoft Marketplace: https://marketplace.microsoft.com/en-us/product/smartvisuals.smartvisuals-sparklines?tab=overview
- Package: https://www.smartvisuals.io/downloads/smartvisuals-sparklines-1.0.0.0.pbiviz
- Sample report (zipped .pbip): https://www.smartvisuals.io/samples/smartvisuals-sparklines-sample-1.0.0.0.zip
- Price: Free tier for every viewer; premium $1.99 per user per month or $19 per user per year on Microsoft Marketplace, with a 30-day free trial. Premium works in edit mode without a licence; unlicensed viewers see the free tier, never a blocked visual.
- Certified by Microsoft: no
- Version: 1.0.0.0
- GUID (visualType and publicCustomVisuals): `smartvisualsSparklines273A71B3DDD15D046A87FA01A562EB26`

## What is free

- **Table or KPI tiles**: A table with columns for name, sparkline, last value, change, change %, minimum, maximum and target, switchable and reorderable, or a grid of KPI tiles with the value, the change and the sparkline.
- **Five spark types**: Line, area, columns, win/loss and last value against the target (a bullet strip).
- **An honest shared scale**: Every row on one scale by default, or independent scales for shape, and then the header says "independent scales".
- **Markers, normal range and target**: Markers for the first, last, minimum, maximum and negative points; a normal range band; a dashed target line.
- **Sorting and a hover label**: Sort by name, last value, change or change %; a label follows the pointer along each sparkline with the date and value.
- **Up to 10 rows, every period**: Ten rows with every period of each, no point cap per sparkline. The table scrolls under a fixed header, and when tiles do not fit, the footnote says how many are shown.
- **Power BI features**: Tooltips with your Tooltips fields on every row and tile, report page tooltips, cross-filter with Ctrl multi-select, bookmarks, the context menu, conditional formatting (fx) on column and win/loss sparklines when the rows are measures, dynamic format strings, four themes and 20 languages.
- **Accessibility**: One tab stop with arrow keys between rows and tiles, a screen-reader live region, arrows and signs besides colour, high contrast, Reduce Motion, focus outline and minimum text size settings.

## What premium adds

- **Every row**: Every row Power BI sends, with no 60-row limit in this visual, in a scrolling table, plus a drawn summary sentence such as "8 of 12 improved; Birmingham moved the most the wrong way (-4.4 %)."
- **Year-end projection per row**: Where each row lands by the end of the year: a dashed tail with its 80 % interval and a Year end column, from an ETS forecast per row.
- **Which rows really changed?**: A Mann-Kendall trend test per row with its p-value, coloured by whether higher is better, and the count of significant rises and falls.
- **Sort by trend**: Rows ordered by Sen's slope, a robust rate of change.
- **Change against the same period last year**: The change measured against the same period a year earlier, looked up by calendar in your data.
- **Small multiples**: One table or tile grid per value of the Small multiples field, such as one per region.

## Fields

| Field | Internal name | Takes | Needed | What it is for |
| --- | --- | --- | --- | --- |
| Axis (date) | `axis` | Column | Optional | The time axis: a date, a date hierarchy level, a number or text periods |
| Legend | `legend` | Column | Optional | One series per value (one row per value in Sparklines) |
| Values | `values` | Measure | Optional | Measures drawn as lines, areas or sparklines |
| Target | `target` | Measure | Optional | Plan, budget or target: a dashed series and the base for variances |
| High | `high` | Measure | Optional | Highest value of each period (candles), or the top of a range band |
| Low | `low` | Measure | Optional | Lowest value of each period (candles), or the bottom of a range band |
| Small multiples | `facet` | Column | Optional | One panel per value (premium) |
| Tooltips | `tooltips` | Measure | Optional | Extra fields in tooltips |

## Format pane

Each card is a key under `visual.objects` in a PBIR visual.json; each setting is a property of it. Toggles take `true`/`false`, choices and text a value in single quotes (`'auto'`), numbers a `D` suffix (`12D`).

### Presets and Templates (`presets`)

| Setting | Internal name | Type or options |
| --- | --- | --- |
| Apply Preset | `preset` | `none` ((choose to apply)), `executive` (Executive), `finance` (Finance (IBCS)), `trading` (Trading), `monitoring` (Monitoring), `print` (Print) |
| Style Template (copy or paste) | `template` | Text |

### Sparklines (`sparklines`)

| Setting | Internal name | Type or options |
| --- | --- | --- |
| Layout | `layout` | `table` (Table), `grid` (Grid of tiles) |
| Sparkline | `type` | `line` (Line), `area` (Area), `column` (Columns), `winloss` (Win / loss), `bullet` (Last value vs target) |
| Table Columns | `columns` | Text |
| Change Compares | `changeBasis` | `window` (Last vs first in view), `previous` (Last vs previous point), `year` (Last vs same period a year ago) |
| Scale | `scale` | `shared` (Shared (honest comparison)), `independent` (Independent per row (shape only)) |
| Sort Rows By | `sortBy` | `data` (Data order), `name` (Name), `last` (Last value), `change` (Change), `changePct` (Change %), `trend` (Trend (Sen's slope)) |
| Sort Direction | `sortDirection` | `asc` (Ascending), `desc` (Descending) |
| Row Height | `rowHeight` | Number |
| Tile Columns (0 = auto) | `tileColumns` | Number |
| Mark First | `markFirst` | On / off |
| Mark Last | `markLast` | On / off |
| Mark Minimum and Maximum | `markMinMax` | On / off |
| Mark Negative Values | `markNegative` | On / off |
| Normal Range From | `bandFrom` | Text |
| Normal Range To | `bandTo` | Text |
| Higher Is Better | `higherIsBetter` | On / off |
| Year-End Projection | `yearEnd` | On / off |

### Data Labels (`labels`)

| Setting | Internal name | Type or options |
| --- | --- | --- |
| Show | `show` | `none` (None), `all` (All points), `last` (Last point), `minmax` (Minimum and maximum), `firstlast` (First and last) |
| Label Every Nth Point | `every` | Number |
| Decimals (-1 = auto) | `decimals` | Number |
| Font Size | `fontSize` | Number |
| Colour | `color` | Colour |
| Background Pill | `background` | On / off |

### Trend Line (`trend`)

| Setting | Internal name | Type or options |
| --- | --- | --- |
| Type | `type` | `none` (None), `linear` (Linear), `poly2` (Polynomial (2nd order)), `poly3` (Polynomial (3rd order)), `poly4` (Polynomial (4th order)), `exponential` (Exponential), `logarithmic` (Logarithmic), `power` (Power), `loess` (LOESS (smooth)), `sma` (Simple moving average), `ema` (Exponential moving average), `wma` (Weighted moving average) |
| Moving Average Periods | `window` | Number |
| LOESS Span (%) | `span` | Number |
| For Every Series | `allSeries` | On / off |
| Line Style | `dash` | `solid` (Solid), `dashed` (Dashed), `dotted` (Dotted), `dashdot` (Dash-dot) |
| Equation and R² in Legend | `showEquation` | On / off |

### Forecast (`forecast`)

| Setting | Internal name | Type or options |
| --- | --- | --- |
| Show Forecast | `show` | On / off |
| Periods Ahead (0 = one season) | `horizon` | Number |
| Or Forecast Through (yyyy-mm-dd) | `through` | Text |
| Model | `model` | `auto` (Automatic (lowest AICc)), `ANN` (Simple exponential smoothing), `AAN` (Holt linear trend), `AAdN` (Damped trend), `ANA` (Seasonal, no trend), `AAA` (Holt-Winters additive), `AAdA` (Holt-Winters damped) |
| Season Length (0 = from dates) | `season` | Number |
| Prediction Interval | `level` | `none` (None), `80` (80 %), `95` (95 %), `both` (80 % and 95 %) |
| Mark Anomalies | `anomalies` | On / off |
| For Every Series | `allSeries` | On / off |

### Trend Test (`trendTest`)

| Setting | Internal name | Type or options |
| --- | --- | --- |
| Test for a Trend (Mann-Kendall) | `show` | On / off |
| Significance Level | `alpha` | `0.1` (10 %), `0.05` (5 %), `0.01` (1 %) |

### X-Axis (`xAxis`)

| Setting | Internal name | Type or options |
| --- | --- | --- |
| Show | `show` | On / off |
| Title | `showTitle` | On / off |
| Font Size | `fontSize` | Number |
| Colour | `color` | Colour |
| Vertical Gridlines | `grid` | On / off |

### Y-Axis (`yAxis`)

| Setting | Internal name | Type or options |
| --- | --- | --- |
| Show | `show` | On / off |
| Title | `showTitle` | On / off |
| Minimum (blank = auto) | `min` | Text |
| Maximum (blank = auto) | `max` | Text |
| Start At Zero | `zero` | `auto` (Automatic (columns and areas)), `always` (Always), `never` (Never) |
| Logarithmic Scale | `log` | On / off |
| Decimals (-1 = auto) | `decimals` | Number |
| Font Size | `fontSize` | Number |
| Colour | `color` | Colour |
| Align Zero Across Axes | `align` | On / off |

### Gridlines (`gridlines`)

| Setting | Internal name | Type or options |
| --- | --- | --- |
| Style | `style` | `theme` (From theme), `solid` (Solid), `dashed` (Dashed), `dotted` (Dotted), `bands` (Zebra bands), `none` (None) |
| Colour | `color` | Colour |

### Legend (`legend`)

| Setting | Internal name | Type or options |
| --- | --- | --- |
| Show | `show` | On / off |
| Position | `position` | `top` (Top), `bottom` (Bottom), `right` (Right) |
| Font Size | `fontSize` | Number |
| Text Colour | `color` | Colour |

### Reference Lines (`refLines`)

| Setting | Internal name | Type or options |
| --- | --- | --- |
| Line 1 | `line1` | `none` (None), `value` (A value), `average` (Average), `median` (Median), `percentile` (Percentile), `min` (Minimum), `max` (Maximum), `target` (Target field (last value)) |
| Line 1 Value | `line1Value` | Number |
| Line 1 Percentile | `line1Pct` | Number |
| Line 1 Label | `line1Label` | Text |
| Line 1 Colour | `line1Color` | Colour |
| Line 2 | `line2` | `none` (None), `value` (A value), `average` (Average), `median` (Median), `percentile` (Percentile), `min` (Minimum), `max` (Maximum), `target` (Target field (last value)) |
| Line 2 Value | `line2Value` | Number |
| Line 2 Percentile | `line2Pct` | Number |
| Line 2 Label | `line2Label` | Text |
| Line 2 Colour | `line2Color` | Colour |
| For Every Series | `perSeries` | On / off |
| Vertical Line | `vertical` | `none` (None), `today` (Today), `date` (A date) |
| Vertical Line Date (yyyy-mm-dd) | `verticalDate` | Text |
| Vertical Line Label | `verticalLabel` | Text |

### Reference Bands (`refBands`)

| Setting | Internal name | Type or options |
| --- | --- | --- |
| Value Band From | `valueFrom` | Text |
| Value Band To | `valueTo` | Text |
| Value Band Label | `valueLabel` | Text |
| Value Band Colour | `valueColor` | Colour |
| Period From (yyyy-mm-dd) | `timeFrom` | Text |
| Period To (yyyy-mm-dd) | `timeTo` | Text |
| Period Label | `timeLabel` | Text |
| Period Colour | `timeColor` | Colour |

### Annotations (`annotations`)

| Setting | Internal name | Type or options |
| --- | --- | --- |
| Style | `style` | `pin` (Pin with label), `flag` (Flag on the axis), `numbered` (Numbered, listed in the footnote) |
| Shade Until the Next Annotation | `shadeUntilNext` | On / off |
| Font Size | `fontSize` | Number |
| Colour | `color` | Colour |

### Zoom (`navigator`)

| Setting | Internal name | Type or options |
| --- | --- | --- |
| Range Navigator | `show` | On / off |
| Navigator Height | `height` | Number |
| Ctrl + Wheel Zooms, Drag Pans | `wheel` | On / off |

### Small Multiples (`smallMultiples`)

| Setting | Internal name | Type or options |
| --- | --- | --- |
| Columns (0 = auto) | `columns` | Number |
| Shared Y-Axis | `sharedY` | On / off |

### Smart Caption (`caption`)

| Setting | Internal name | Type or options |
| --- | --- | --- |
| Show | `show` | On / off |
| Position | `position` | `top` (Top), `bottom` (Bottom) |
| Font Size | `fontSize` | Number |
| Text Colour | `color` | Colour |

### Footnote (`footnote`)

| Setting | Internal name | Type or options |
| --- | --- | --- |
| Show | `show` | On / off |
| Source | `source` | Text |
| State the Methods | `showMethod` | On / off |
| Font Size | `fontSize` | Number |
| Text Colour | `color` | Colour |

### Accessibility (`accessibility`)

| Setting | Internal name | Type or options |
| --- | --- | --- |
| Distinguish Series Without Colour | `distinguish` | On / off |
| Focus Outline Colour | `focusColor` | Colour |
| Focus Outline Width | `focusWidth` | Number |
| Minimum Text Size (0 = off) | `minFontSize` | Number |

### Theme (`theme`)

| Setting | Internal name | Type or options |
| --- | --- | --- |
| Theme | `selectedTheme` | `smartvisuals` (SmartVisuals), `dark` (Dark), `clean` (Clean (White)), `slate` (Slate) |
| Font | `font` | `inter` (Inter), `segoe` (Segoe UI), `arial` (Arial), `georgia` (Georgia) |
| Transparent Background | `transparentBg` | On / off |

### Series Colours (`seriesColors`)

| Setting | Internal name | Type or options |
| --- | --- | --- |
| Colour | `fill` | Colour |

### Data Colours (`dataPoint`)

| Setting | Internal name | Type or options |
| --- | --- | --- |
| Colour | `fill` | Colour |
