# Bar Chart Told in Reading Order (按阅读顺序长出的柱状图)

Six bars grow left to right in reading order; only the last one takes the accent color and carries its value, so the chart makes one point.

- Ref: `video/motion-data-chart-story` (code video · motion · launch, changelog, brand, any · any · 5s at 30fps)
- Page: https://uifino.com/en/videos/motion-data-chart-story
- Markdown: https://uifino.com/md/videos/motion-data-chart-story.md
- Preview image: https://uifino.com/videos/motion-data-chart-story/poster.jpg

## Install

- ZIP: https://uifino.com/videos/motion-data-chart-story/source.zip

Six bars grow left to right in reading order; only the last one takes the accent color and carries its value, so the chart makes one point.

Rendered video: https://uifino.com/videos/motion-data-chart-story/preview.mp4

## Beats

- 0-1s State the point first: Baseline draws from the left at 0.1 s; at 0.2 s the two headline lines rise from masks, expo.out 0.9 s, 0.1 s apart Camera: static. On-screen text: "Fastest growth: last week".
- 1-2.4s Six bars grow in reading order: From 1.0 s one bar every 0.1 s, scaleY 0 to 1, power3.out 0.9 s; first five #B4B1A8, the last #2F5BFF Camera: static.
- 2.1-2.7s Label only the bar that matters: At 2.1 s the value 3,600 rises from a mask, expo.out 0.6 s, 64px Camera: static. On-screen text: "3,600".
- 2.7-5s Let the viewer read: Fully still: no scale, drift or breathing Camera: static.

## Parameters

- `title` Headline (| splits lines): default 最近一周，|增长最快
- `values` Six values, comma separated; the last is highlighted: default 1180,1420,1330,1690,1980,3600
- `accentColor` Accent color: default #2F5BFF
- `bg` Background: default #E8E6E1
- `ink` Text color: default #1C1C1A
- `rule` Baseline color: default #A8A59C
- `bar` Neutral bar color: default #B4B1A8
- `titleStart` Headline start: default 0.2s, range 0 to 0.6s
- `titleDuration` Headline rise duration: default 0.9s, range 0.5 to 1.4s
- `barStart` First bar start: default 1s, range 0.6 to 1.6s
- `barStagger` Gap between bars: default 0.1s, range 0.08 to 0.12s
- `barDuration` Bar grow duration: default 0.9s, range 0.6 to 1.3s
- `barEase` Bar ease: default power3.out
- `valueDelay` Value delay after the last bar starts: default 0.6s, range 0.3 to 1s

## Good for

- One chart making one point, such as fastest growth last week
- Five to eight like values with one that matters
- Headline works in Chinese and English

## Not for

- Multi-series charts that need exact readings
- Line, pie, stacked or legend-heavy charts

## Source files (plain text)

- https://uifino.com/videos/motion-data-chart-story/source/SPEC.md
- https://uifino.com/videos/motion-data-chart-story/source/PROMPT.md
- https://uifino.com/videos/motion-data-chart-story/source/NOTICE.md
- https://uifino.com/videos/motion-data-chart-story/source/project/assets/fonts/OFL.txt
- https://uifino.com/videos/motion-data-chart-story/source/project/claims.json
- https://uifino.com/videos/motion-data-chart-story/source/project/compositions/chart.html
- https://uifino.com/videos/motion-data-chart-story/source/project/hyperframes.json
- https://uifino.com/videos/motion-data-chart-story/source/project/index.html

## How to use

- Copy the beats and parameters; replace only the copy, the accent color and the product screenshots.
- `PROMPT.md` has two prompts: one to reproduce this video exactly, one to learn only the technique.
- Build with HyperFrames (`/hyperframes`); the project in the ZIP is a ready starting point.

## Files

| Path | Role | Size |
| :--- | :--- | ---: |
| PROMPT.md | doc | 2.8 KB |
| SPEC.md | doc | 5.4 KB |

### PROMPT.md

```md
# PROMPT：motion-data-chart-story

## 照抄复刻
用 `/hyperframes` 做一个 1920×1080、30 fps、5 秒的柱状图动效。底色 `#E8E6E1`，主字 `#1C1C1A`，底线 `#A8A59C`，普通柱子 `#B4B1A8`，强调色 `#2F5BFF`。字体用本地 `@font-face`：中文思源黑体，数字和西文 IBM Plex Sans，不要联网取字体。圆角、阴影、渐变都不要。

做法：
1. 版面：标题靠左，左边缘 x=160，宽 720，120px、字重 600、行高 144px、字距 -0.02em，最后一行底边落在 y=900。图表在右半：底线 x=920 到 1760、y=900 起 2px 高；六根柱子宽 100px，左边缘 x=920、1068、1216、1364、1512、1660（步长 148px），柱底 y=900，最高柱 640px，其余按数值比例。画面上没有刻度、网格、图例、周标签。
2. 数据：1180、1420、1330、1690、1980、3600（演示数据，换成你自己的六个数）。最后一根用强调色，前五根用 `#B4B1A8`。
3. 0.1 秒起底线从左画出（`scaleX` 0 到 1，`expo.out`，0.8 秒）。0.2 秒起标题两行各套 `overflow: hidden` 遮罩，从下沿升起（`yPercent` 115 到 0，`expo.out`，0.9 秒，行间隔 0.1 秒）。
4. 1.0 秒起六根柱子从左到右依次长出，每根间隔 0.1 秒（1.0、1.1、1.2、1.3、1.4、1.5 秒开始）：`scaleY` 0 到 1，原点在柱底，`power3.out`，0.9 秒。
5. 最后一根柱子开始后 0.6 秒（2.1 秒）起，它的数值 3,600 从遮罩下沿升起（`expo.out`，0.6 秒），64px、字重 600、强调色，宽 300px 居中在柱子上，底边离柱顶 16px。
6. 2.7 秒到 5.0 秒完全静止，没有退场。

需要替换的地方（都是场景根上的变量，在挂载处用 `data-variable-values` 传）：
- `title`（标题，`|` 分行，默认「最近一周，|增长最快」，英文 `Fastest|growth:|last week`，英文要拆三行才放得下）、`values`（六个数，逗号分隔，最后一个是强调项）。
- 颜色：`accentColor`、`bg`、`ink`、`rule`、`bar`。
- 时间与缓动：`titleStart` 0.2、`titleDuration` 0.9、`barStart` 1、`barStagger` 0.1（取 0.08 到 0.12）、`barDuration` 0.9、`barEase` power3.out、`valueDelay` 0.6。
- 柱子位置和高度由脚本按数值算出，不用手改；柱子固定六根：`values` 不足六个数时，用最后一个数补齐，多于六个只取前六个，强调色永远给第六根。
- 版面常量（不是变量，在 `chart.html` 里改）：标题行间隔 0.1 秒、底线动画 0.1 秒起 0.8 秒、数值升起 0.6 秒。

## 只学手法
图表只讲一个结论：柱子从左到右每隔 0.1 秒依次长出（`scaleY`，原点在柱底，`power3.out` 0.9 秒），前面的全部用中性灰，只有最后一根用强调色，并在它快长完时升起数值；没有刻度、网格和图例，整张图只有一条底线。
```

### SPEC.md

```md
# SPEC：motion-data-chart-story

## LOOK
- 色值（中性色 4 个，强调色 1 个）：底 `#E8E6E1`；主字 `#1C1C1A`；线 `#A8A59C`（只给底线；比普通柱子深一档，对底色约 2:1，底线画出的动作才看得见）；普通柱子 `#B4B1A8`；强调色 `#2F5BFF`（只给最后一根柱子和它的数值，面积约 3%）。BRIEF 里的次要字 `#6E6C66` 这条片里没有次要文字，不用，不进变量。
- 字体：中文 Noto Sans SC（`assets/fonts/noto-sans-sc.woff2`），数字和西文 IBM Plex Sans（`assets/fonts/ibm-plex-sans.woff2`），都是门禁按用到的字生成的本地子集，OFL。
- 字号只有两档：标题 120px（字重 600，字距 -0.02em，行高 144px）；柱顶数值 64px（字重 600，字距 -0.02em，行高 80px，`tabular-nums`）。
- 圆角：无（0）。阴影：无。没有渐变、网格、刻度、图例、坐标轴文字。
- 版面：标题靠左，左边缘 x=160，宽 720，最后一行底边贴着底线（底边 y=900）；图表在右半，底线 x=920 到 1760、y=900 起 2px 高（在柱底之下）。六根柱子宽 100px，左边缘 x=920、1068、1216、1364、1512、1660（步长 148px，间隙 48px），柱底 y=900。最高柱高 640px（柱顶 y=260），其余按数值比例缩放。
- 数值标签：宽 300px，水平居中在最后一根柱子上，行高 80px，底边离柱顶 16px（默认柱顶 y=260，标签 top=164）。

## MOTION
- 底线：0.1 秒起从左向右画出，`scaleX` 0 到 1，`expo.out`，0.8 秒。
- 标题：0.2 秒起，每行各套一层 `overflow: hidden` 遮罩，从遮罩下沿升起，`yPercent` 115 到 0，`expo.out`，0.9 秒，行间隔 0.1 秒。落定后完全不动。
- 柱子：1.0 秒起从左到右依次长出，第 n 根（n 从 0 数）开始于 1.0 + 0.1 × n 秒，`scaleY` 0 到 1，原点在柱底，`power3.out`，0.9 秒。六根依次开始于 1.0、1.1、1.2、1.3、1.4、1.5 秒，最后一根 2.4 秒落定。柱子无圆角，所以缩放不会让圆角变形。
- 数值：最后一根柱子开始后 0.6 秒（2.1 秒）起，从遮罩下沿升起，`yPercent` 115 到 0，`expo.out`，0.6 秒，2.7 秒落定。
- 静止：2.7 秒到 5.0 秒完全不动，没有呼吸、漂移、退场。镜头固定。
- 缓动只用 `expo.out`（到达）和 `power3.out`（柱子，BRIEF 指定）。

## 逐拍节拍表
| 拍 | 起止秒 | 画面 | 镜头 | 转场 | 屏幕文案原文 |
| --- | --- | --- | --- | --- | --- |
| title | 0.0 - 1.0 | 底线画出，标题两行从遮罩升起 | 固定 | 无 | 最近一周，增长最快 |
| bars | 1.0 - 2.4 | 六根柱子依次长出，前五根中性灰，最后一根强调蓝 | 固定 | 无 | 无 |
| value | 2.1 - 2.7 | 最后一根柱顶升起数值 | 固定 | 无 | 3,600 |
| hold | 2.7 - 5.0 | 完全静止 | 固定 | 无 | 最近一周，增长最快 / 3,600 |

英文版：标题变量填 `Fastest|growth:|last week`（`|` 是换行，英文 120px 放不下一行，所以拆成三行），其余不变。三行标题高 432px，底边仍贴底线。

## 参数接线
全部是 `project/compositions/chart.html` 根元素 `data-composition-variables` 里的变量，用户的 AI 在 `index.html` 挂载处用 `data-variable-values` 覆盖。默认值与代码常量表 `D` 一致：
- 内容：`title` 最近一周，|增长最快（`|` 分行）；`values` 1180,1420,1330,1690,1980,3600（柱子固定六根，强调项永远是第六根）。代码处理：去掉非正数和非数字，多于六个只取前六个，不足六个用最后一个数补齐，全部无效时回到默认值。
- 外观：`accentColor` #2F5BFF、`bg` #E8E6E1、`ink` #1C1C1A、`rule` #A8A59C、`bar` #B4B1A8。
- 时间与动作：`titleStart` 0.2、`titleDuration` 0.9、`barStart` 1、`barStagger` 0.1、`barDuration` 0.9、`barEase` power3.out、`valueDelay` 0.6。
- 不是变量的版面常量（在 `chart.html` 里改）：图表高 640px、柱宽 100px、步长 148px、图表左边 x=920、底线 y=900、标题字号 120px、数值字号 64px、标题行间隔 0.1 秒（`stagger`）、底线动画 0.1 秒起 0.8 秒、数值升起 0.6 秒。`index.html` 与场景的 `data-duration` 5 也不是变量。
- 演示数据的出处写在 `project/claims.json`。

## 禁用项
3D 柱子、渐变填充、图例、多余刻度、坐标轴文字、网格线、柱子弹跳、数值计数滚动、强调柱的辉光、淡入加上滑、全部柱子同时出现、静止段里的呼吸漂移。

## 已知取舍
- 柱子下面没有周标签，画面只有标题和最后一根柱的数值，是为了遵守「画面不写标签」和「坐标轴尽量少」；代价是普通柱子本身不说明它们是什么，靠标题和对比读。
- 数值只显示数字 3,600，没有单位，因为单位随用户的数据而变，放进标题里由用户自己写。
- 门禁警告 `cream-palette`：底色 `#E8E6E1` 是 BRIEF 指定的 stone 配色，不是随手选的米色；整片只有一条底线和一根强调柱，靠强调色和大标题立住，不靠底色。
- 门禁警告 `first_frame_empty`：第 0 帧只有底色，标题和底线 0.1–0.2 秒起才进来。这是一条动效手法条目，要演示的就是「从空画面里按顺序长出来」；放进整片时由上一镜头承接，不单独当封面。封面取 3.2 秒。
- 英文版用 `Fastest|growth:|last week` 已用门禁截图确认：三行标题底边仍贴底线，不碰图表。字体子集按中文版用到的字生成，换成英文要重新跑一次门禁生成子集。
```
