Componentes
Gráficos
A forma pela pergunta, escala com números redondos, três séries validadas, rampa de um tom e estado com as cores de estado. Quem desenha é o produto.
Quando não usar
- rosca ou pizza sem as regras de uso (ver “Evite, e se usar, assim”)
- grade tracejada
- texto abaixo de 12 px
- texto dentro do SVG; SVG de largura fixa reduzido para caber
- rótulo de eixo que quebra em duas linhas
- categoria zerada na legenda
- “hoje” em vermelho
- trilho atrás de barras em ordem
- “0” escrito em período sem valor
- minigráfico sozinho, sem o número
Barra única e medidor
- Em execução · 5
- Replanejando · 1
- Travado · 1
Horas extras do mês · 18 de 40
- Em execução · 5
- Replanejando · 1
- Travado · 1
Horas extras do mês · 18 de 40
<figure class="hx-chart">
<figcaption>Projetos por situação</figcaption>
<div class="hx-bar-stack" role="img" aria-label="5 em execução, 1 replanejando, 1 travado"><span class="hx-state-info" style="flex:5"></span><span class="hx-state-warning" style="flex:1"></span><span class="hx-state-danger" style="flex:1"></span></div>
<ul class="hx-legend"><li class="hx-state-info"><span class="hx-legend-key"></span>Em execução · 5</li><li class="hx-state-warning"><svg class="hx-icon" aria-hidden="true"><use href="hibex/icons/sprite.svg?v=8a1e311932#icon-triangle-alert"></use></svg>Replanejando · 1</li><li class="hx-state-danger"><svg class="hx-icon" aria-hidden="true"><use href="hibex/icons/sprite.svg?v=8a1e311932#icon-octagon-alert"></use></svg>Travado · 1</li></ul>
<p class="hx-stat-label">Horas extras do mês · 18 de 40</p>
<div class="hx-meter" role="img" aria-label="18 de 40 horas"><span style="width:45%"></span></div>
</figure>Colunas
Próximas 4 semanas, em horas
- Reservadas
- Livres
Próximas 4 semanas, em horas
- Reservadas
- Livres
<figure class="hx-chart">
<figcaption>Capacidade da agenda</figcaption>
<p class="hx-chart-subtitle">Próximas 4 semanas, em horas</p>
<div class="hx-chart-plot" role="img" aria-label="Capacidade por semana: 28/09, sem agenda; 05/10, 3h30 de 16h; 12/10, 0h30 de 12h; 19/10, 2h de 16h">
<div class="hx-chart-y"><span style="bottom:0%">0 h</span><span style="bottom:25%">4 h</span><span style="bottom:50%">8 h</span><span style="bottom:75%">12 h</span><span style="bottom:100%">16 h</span></div>
<div class="hx-chart-area">
<svg viewBox="0 0 100 100" preserveAspectRatio="none" aria-hidden="true"><line class="hx-chart-grid" x1="0" x2="100" y1="100" y2="100"/><line class="hx-chart-grid" x1="0" x2="100" y1="75" y2="75"/><line class="hx-chart-grid" x1="0" x2="100" y1="50" y2="50"/><line class="hx-chart-grid" x1="0" x2="100" y1="25" y2="25"/><line class="hx-chart-grid" x1="0" x2="100" y1="0" y2="0"/></svg>
<div class="hx-chart-columns">
<span class="hx-chart-column"><span class="hx-chart-value hx-chart-empty">sem agenda</span></span>
<span class="hx-chart-column" style="height:100%"><span class="hx-chart-segment hx-ramp-4" style="flex-grow:3.5" title="05/10: 3h30 reservadas"></span><span class="hx-chart-segment hx-ramp-1" style="flex-grow:12.5" title="05/10: 12h30 livres"></span><span class="hx-chart-value">3h30<span class="hx-chart-minor"> de 16h</span></span></span>
<span class="hx-chart-column" style="height:75%"><span class="hx-chart-segment hx-ramp-4" style="flex-grow:0.5" title="12/10: 0h30 reservadas"></span><span class="hx-chart-segment hx-ramp-1" style="flex-grow:11.5" title="12/10: 11h30 livres"></span><span class="hx-chart-value">0h30<span class="hx-chart-minor"> de 12h</span></span></span>
<span class="hx-chart-column" style="height:100%"><span class="hx-chart-segment hx-ramp-4" style="flex-grow:2" title="19/10: 2h reservadas"></span><span class="hx-chart-segment hx-ramp-1" style="flex-grow:14" title="19/10: 14h livres"></span><span class="hx-chart-value">2h<span class="hx-chart-minor"> de 16h</span></span></span>
</div>
</div>
<div class="hx-chart-x"><span>28/09</span><span>05/10</span><span>12/10</span><span>19/10</span></div>
</div>
<ul class="hx-legend"><li class="hx-ramp-4"><span class="hx-legend-key"></span>Reservadas</li><li class="hx-ramp-1"><span class="hx-legend-key"></span>Livres</li></ul>
</figure>Linha em degraus
R$ por moeda Hibex; um ponto a cada mudança
R$ por moeda Hibex; um ponto a cada mudança
<figure class="hx-chart">
<figcaption>Evolução da cotação</figcaption>
<p class="hx-chart-subtitle">R$ por moeda Hibex; um ponto a cada mudança</p>
<div class="hx-chart-plot" role="img" aria-label="Cotação da moeda Hibex em 365 dias: de R$ 1,07 a R$ 1,00; máxima R$ 1,15, mínima R$ 0,81; 12 mudanças.">
<div class="hx-chart-y"><span style="bottom:0%">0,80</span><span style="bottom:25%">0,90</span><span style="bottom:50%">1,00</span><span style="bottom:75%">1,10</span><span style="bottom:100%">1,20</span></div>
<div class="hx-chart-area">
<svg viewBox="0 0 100 100" preserveAspectRatio="none" aria-hidden="true"><line class="hx-chart-grid" x1="0" x2="100" y1="100" y2="100"/><line class="hx-chart-grid" x1="0" x2="100" y1="75" y2="75"/><line class="hx-chart-grid" x1="0" x2="100" y1="50" y2="50"/><line class="hx-chart-grid" x1="0" x2="100" y1="25" y2="25"/><line class="hx-chart-grid" x1="0" x2="100" y1="0" y2="0"/><path class="hx-chart-line hx-series-1" d="M0,32.5 H8.5 V12.5 H21.1 V55 H28.8 V77.5 H37 V80 H46.6 V42.5 H58.1 V20 H67.4 V47.5 H74.5 V75 H83.6 V60 H92.6 V82.5 H98.6 V97.5 H100 V50"/></svg>
<span class="hx-chart-dot hx-series-1" style="left:0%;bottom:67.5%" title="R$ 1,07"></span>
<span class="hx-chart-dot hx-series-1" style="left:8.5%;bottom:87.5%" title="R$ 1,15"></span>
<span class="hx-chart-dot hx-series-1" style="left:21.1%;bottom:45%" title="R$ 0,98"></span>
<span class="hx-chart-dot hx-series-1" style="left:28.8%;bottom:22.5%" title="R$ 0,89"></span>
<span class="hx-chart-dot hx-series-1" style="left:37%;bottom:20%" title="R$ 0,88"></span>
<span class="hx-chart-dot hx-series-1" style="left:46.6%;bottom:57.5%" title="R$ 1,03"></span>
<span class="hx-chart-dot hx-series-1" style="left:58.1%;bottom:80%" title="R$ 1,12"></span>
<span class="hx-chart-dot hx-series-1" style="left:67.4%;bottom:52.5%" title="R$ 1,01"></span>
<span class="hx-chart-dot hx-series-1" style="left:74.5%;bottom:25%" title="R$ 0,90"></span>
<span class="hx-chart-dot hx-series-1" style="left:83.6%;bottom:40%" title="R$ 0,96"></span>
<span class="hx-chart-dot hx-series-1" style="left:92.6%;bottom:17.5%" title="R$ 0,87"></span>
<span class="hx-chart-dot hx-series-1" style="left:98.6%;bottom:2.5%" title="R$ 0,81"></span>
<span class="hx-chart-dot hx-series-1 hx-chart-dot-current" style="left:100%;bottom:50%" title="R$ 1,00"></span>
<span class="hx-chart-value" style="left:100%;bottom:50%">R$ 1,00</span>
</div>
<div class="hx-chart-x hx-chart-x-time"><span style="left:0%">out</span><span class="hx-chart-minor" style="left:8.3%">nov</span><span class="hx-chart-minor" style="left:16.7%">dez</span><span style="left:25%">jan</span><span class="hx-chart-minor" style="left:33.3%">fev</span><span class="hx-chart-minor" style="left:41.7%">mar</span><span style="left:50%">abr</span><span class="hx-chart-minor" style="left:58.3%">mai</span><span class="hx-chart-minor" style="left:66.7%">jun</span><span style="left:75%">jul</span><span class="hx-chart-minor" style="left:83.3%">ago</span><span class="hx-chart-minor" style="left:91.7%">set</span><span style="left:100%">out</span></div>
</div>
</figure>Linha do tempo com marcos
- 1. Chamada de apresentação
- 2. Anotações da ideia
- 3. Análise do material
- 4. Homologação do escopo
- Chamada (um momento)
- A Hibex faz
- O cliente faz
- Previsto em contorno
- 1. Chamada de apresentação
- 2. Anotações da ideia
- 3. Análise do material
- 4. Homologação do escopo
- Chamada (um momento)
- A Hibex faz
- O cliente faz
- Previsto em contorno
<figure class="hx-chart hx-chart-timeline">
<figcaption>Linha do tempo do roteiro</figcaption>
<div class="hx-chart-plot hx-chart-plot-rows" role="img" aria-label="Quatro etapas de 29/09 a 07/10; hoje 02/10; as duas primeiras feitas.">
<div class="hx-chart-rows"><span>1. Chamada de apresentação</span><span>2. Anotações da ideia</span><span>3. Análise do material</span><span>4. Homologação do escopo</span></div>
<div class="hx-chart-area">
<svg viewBox="0 0 100 100" preserveAspectRatio="none" aria-hidden="true"><line class="hx-chart-grid" x1="0" x2="0" y1="0" y2="100"/><line class="hx-chart-grid" x1="33.3" x2="33.3" y1="0" y2="100"/><line class="hx-chart-grid" x1="66.7" x2="66.7" y1="0" y2="100"/><line class="hx-chart-grid" x1="100" x2="100" y1="0" y2="100"/><line class="hx-chart-today" x1="21" x2="21" y1="0" y2="100"/></svg>
<span class="hx-chart-value hx-chart-value-top" style="left:21%">hoje</span>
<div class="hx-chart-track"><span class="hx-chart-milestone" style="left:7.1%" title="1. Chamada de apresentação"></span></div>
<div class="hx-chart-track"><span class="hx-chart-bar hx-series-2" style="left:4.8%;width:calc(14.3% - 2px)" title="2. Anotações da ideia"></span></div>
<div class="hx-chart-track"><span class="hx-chart-bar hx-series-1 hx-chart-planned" style="left:19%;width:calc(14.3% - 2px)" title="3. Análise do material"></span></div>
<div class="hx-chart-track"><span class="hx-chart-bar hx-series-2 hx-chart-planned" style="left:33.3%;width:calc(14.3% - 2px)" title="4. Homologação do escopo"></span></div>
</div>
<div class="hx-chart-x hx-chart-x-time"><span style="left:0%">28/09</span><span style="left:33.3%">05/10</span><span style="left:66.7%">12/10</span><span style="left:100%">19/10</span></div>
</div>
<ul class="hx-panel-list hx-chart-timeline-list"><li><span>1. Chamada de apresentação</span><span class="hx-meta">29/09 · chamada · feito</span></li><li><span>2. Anotações da ideia</span><span class="hx-meta">29/09 a 01/10 · o cliente faz · feito</span></li><li><span>3. Análise do material</span><span class="hx-meta">02/10 a 04/10 · a Hibex faz · previsto</span></li><li><span>4. Homologação do escopo</span><span class="hx-meta">05/10 a 07/10 · o cliente faz · previsto</span></li></ul>
<ul class="hx-legend"><li><span class="hx-chart-milestone"></span>Chamada (um momento)</li><li class="hx-series-1"><span class="hx-legend-key"></span>A Hibex faz</li><li class="hx-series-2"><span class="hx-legend-key"></span>O cliente faz</li><li><span class="hx-legend-key hx-chart-planned"></span>Previsto em contorno</li></ul>
</figure>Minigráfico
Valor-hora
H$ 82,00
Valor-hora
H$ 82,00
<div class="hx-card"><div class="hx-stat">
<p class="hx-stat-label">Valor-hora</p>
<div class="hx-stat-row"><p class="hx-stat-value"><span class="hx-stat-unit">H$</span> 82,00</p>
<svg class="hx-sparkline" width="128" height="36" viewBox="0 0 128 36" role="img" aria-label="De H$ 79,00 a H$ 82,00 em 90 dias">
<path class="hx-chart-line hx-series-1" d="M2,24 H15.3 V24 H28.7 V26 H42 V26 H55.3 V22 H68.7 V22 H82 V24 H95.3 V20 H108.7 V20 H122 V4"/>
<circle class="hx-chart-point hx-series-1" cx="122" cy="4" r="4"/></svg></div>
<p class="hx-meta">+H$ 3,00 em 90 dias</p>
</div></div>Barras em ordem e medidor com referência
- Projeto de Software Avulso8
- MVP para Startups5
- Consultoria Pontual3
previsto
- Projeto de Software Avulso8
- MVP para Startups5
- Consultoria Pontual3
previsto
<figure class="hx-chart">
<figcaption>Mais solicitados nos últimos 12 meses</figcaption>
<ol class="hx-ranking">
<li><span class="hx-ranking-label">Projeto de Software Avulso</span><span class="hx-ranking-bar"><span style="width:100%"></span></span><span class="hx-ranking-value">8</span></li>
<li><span class="hx-ranking-label">MVP para Startups</span><span class="hx-ranking-bar"><span style="width:63%"></span></span><span class="hx-ranking-value">5</span></li>
<li><span class="hx-ranking-label">Consultoria Pontual</span><span class="hx-ranking-bar"><span style="width:38%"></span></span><span class="hx-ranking-value">3</span></li>
</ol>
<p class="hx-meta">e mais 4 fluxos, com 1 solicitação cada — <a href="#">ver todos</a></p>
</figure>
<figure class="hx-chart">
<figcaption>Horas por projeto</figcaption>
<div class="hx-progress-field"><span class="hx-label">Bom Preço · e-commerce</span>
<span class="hx-progress-value">52h de 45h30 · <span class="hx-chart-note hx-state-warning"><svg class="hx-icon" aria-hidden="true"><use href="hibex/icons/sprite.svg?v=8a1e311932#icon-triangle-alert"></use></svg>6h30 além</span></span>
<div class="hx-meter hx-meter-target" role="img" aria-label="52h de 45h30 previstas, 6h30 além"><span style="width:80%"></span><span class="hx-meter-over" style="width:11.4%"></span><span class="hx-meter-mark" style="left:80%"></span></div>
<p class="hx-meter-caption"><span style="left:80%">previsto</span></p></div>
</figure>Evite, e se usar, assim
A tabela “Pela pergunta” é orientação, não lista fechada: uma forma fora dela pode ser usada, seguindo as regras de marca, cor, escala, texto e acessibilidade desta página (ADR-0052). Rosca e pizza se evitam, porque ângulos se comparam pior que comprimentos — para partes de um todo, a barra única empilhada responde melhor. Se usar:
- até 4 partes: as três séries e “Outros”; com mais, agrupe ou use barras;
- número e percentual de cada parte escritos ao lado ou na legenda, nunca só a fatia; categorias zeradas fora;
- a maior parte primeiro, a partir do topo, no sentido horário;
- rosca em vez de pizza quando houver um total a mostrar: o total vai no centro;
- nunca para comparar dois gráficos lado a lado: aí, barras com a mesma escala;
- sem 3D, sem fatia destacada para fora, 2 px de folga entre as partes;
- “Ver como tabela” e
aria-label, como todo gráfico.
10projetos
- Em andamento770%
- Replanejando220%
- Travado110%
10projetos
- Em andamento770%
- Replanejando220%
- Travado110%
<figure class="hx-chart">
<figcaption>Projetos ativos</figcaption>
<div class="hx-chart-pie" role="img" aria-label="10 projetos ativos: 7 em andamento, 2 replanejando, 1 travado">
<div class="hx-chart-pie-ring">
<svg viewBox="0 0 160 160" aria-hidden="true">
<circle class="hx-series-1" cx="80" cy="80" r="68" stroke-dasharray="297.1 130.2" stroke-dashoffset="0.0"><title>Em andamento: 7</title></circle>
<circle class="hx-series-2" cx="80" cy="80" r="68" stroke-dasharray="83.5 343.8" stroke-dashoffset="-299.1"><title>Replanejando: 2</title></circle>
<circle class="hx-series-3" cx="80" cy="80" r="68" stroke-dasharray="40.7 386.5" stroke-dashoffset="-384.5"><title>Travado: 1</title></circle>
</svg>
<p class="hx-chart-pie-total"><span>10</span><span>projetos</span></p>
</div>
<ul class="hx-legend hx-legend-values">
<li class="hx-series-1"><span class="hx-legend-key"></span>Em andamento<span>7</span><span>70%</span></li>
<li class="hx-series-2"><span class="hx-legend-key"></span>Replanejando<span>2</span><span>20%</span></li>
<li class="hx-series-3"><span class="hx-legend-key"></span>Travado<span>1</span><span>10%</span></li>
</ul>
</div>
</figure>.hx-chart-pie (ADR-0059). A conta é do produto: com r = 68, a circunferência é 2π × 68 ≈ 427,3; cada parte tem stroke-dasharray = (comprimento − 2) e (o resto + 2), e stroke-dashoffset = − a soma das anteriores. A primeira parte começa no topo e o anel corre no sentido horário. "Outros" leva .hx-chart-pie-other; a pizza, sem total, .hx-chart-pie-solid com r = 40.Pela pergunta
| Pergunta | Forma |
|---|---|
| Quanto, por período? | colunas (empilhadas se forem partes do total); período sem valor fica sem marca e sem “0”, e o subtítulo diz que não houve |
| Como mudou com o tempo? | linha; em degraus quando o valor muda em instantes; um ponto por mudança (até ~40) e o seletor de período alinhado ao título |
| Como se divide um todo? | barra única empilhada |
| Quanto de um limite? | medidor |
| Quanto do previsto, e passou? | medidor com referência |
| Quando acontece cada coisa? | linha do tempo com marcos |
| Quais são os maiores? | barras em ordem |
| Para que lado vai este número? | minigráfico ao lado do número |
| A mesma pergunta para vários grupos, ou mais de 3 séries? | pequenos múltiplos: mesma escala, mesmo tamanho, uma legenda só |
| A resposta é um número? | número de destaque, não gráfico |
Referência
| Classe ou atributo | Para quê |
|---|---|
.hx-chart | contêiner (a figura) |
.hx-chart-plot | montagem: eixo Y | área, eixo X embaixo; role="img" e aria-label aqui; área com 200 px de altura |
.hx-chart-y, .hx-chart-x, .hx-chart-x-time | eixos em HTML, 12 px, numa linha só: rótulo por bottom em %; categorias na grade das colunas ou tempo por left em % |
.hx-chart-area | área: o SVG (viewBox="0 0 100 100", preserveAspectRatio="none") atrás, o HTML na frente |
.hx-chart-grid, .hx-chart-line | grade e linha no SVG, com traço sem escala |
.hx-chart-columns, -column, -segment | colunas em HTML: altura em %, segmentos por flex-grow |
.hx-chart-dot, -dot-current | ponto em HTML (left e bottom em %); o de agora fica no cartão estreito |
.hx-chart-value, -value-top, -empty | rótulo de valor, 13 px: no topo da coluna, junto de um ponto ou acima da área; “sem agenda” |
.hx-chart-minor | o que sai no cartão estreito (menos de 30rem): rótulos intermediários, a parte final de um rótulo |
.hx-chart-cells | células (mapa de calor) em HTML |
.hx-series-1…3, .hx-ramp-1…5, .hx-state-* | cor pelo trabalho (fundo no HTML, fill no SVG) |
.hx-legend, .hx-legend-key | legenda |
.hx-bar-stack, .hx-meter | barra única e medidor em HTML |
.hx-chart-table | "Ver como tabela" em <details> |
.hx-chart-header, .hx-chart-subtitle | título com seletor de período; subtítulo (o que não aparece) |
.hx-chart-timeline, -timeline-list | linha do tempo: o gráfico e a lista que o substitui no celular |
.hx-chart-plot-rows, .hx-chart-rows, .hx-chart-track, .hx-chart-bar | linha do tempo: rótulos de linha em HTML, uma trilha por item, barra para o que dura |
.hx-chart-milestone, -planned, -today, -forecasts, -forecast, -forecast-initial | momento (losango), previsto (contorno), hoje (traço no SVG), previsões atual e inicial abaixo do eixo |
.hx-ranking, -label, -bar, -value | barras em ordem |
.hx-meter-target, .hx-meter-over, .hx-meter-mark, .hx-meter-caption | medidor com referência |
.hx-chart-note + .hx-state-* | nota com ícone na cor do papel |
.hx-sparkline, .hx-stat-row | minigráfico ao lado do número |
.hx-chart-multiples | pequenos múltiplos |
Origem: cap. 06 §3.6, §3.8 e §3.9 · ADR-0024, ADR-0045 e ADR-0046 · desde a versão 0.1.0