Skip to content
Back to skills

Axis

ASecurity

Linear axis components for cartesian charts. Configurable tick formatting, label rotation, positioning, and axis line styling.

  • 4 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added May 27, 2026
data-aigoreact

Works with

  • cli

Security analysis

A100/100

Scanned May 27, 2026

npx -y skills add reaviz/skills --skill axis --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Axis?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Axis
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/reaviz-axis/badge)](https://www.skillsdirectory.com/skills/reaviz-axis)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
# Axis

Linear axis components for cartesian charts. Configurable tick formatting, label rotation, positioning, and axis line styling.

## Import

```tsx
import {
  LinearXAxis,
  LinearXAxisTickSeries,
  LinearXAxisTickLabel,
  LinearXAxisTickLine,
  LinearYAxis,
  LinearYAxisTickSeries,
  LinearYAxisTickLabel,
  LinearYAxisTickLine,
  LinearAxisLine
} from 'reaviz';
```

## LinearXAxis / LinearYAxis Props

| Prop | Type | Default (X) | Default (Y) | Description |
|------|------|-------------|-------------|-------------|
| `type` | `'value' \| 'time' \| 'category' \| 'duration'` | `'value'` | `'value'` | Scale type |
| `position` | `'start' \| 'end' \| 'center'` | `'end'` | `'start'` | Axis placement |
| `orientation` | `'horizontal' \| 'vertical'` | `'horizontal'` | `'vertical'` | Axis direction |
| `scaled` | `boolean` | `false` | `false` | Scale to data extent |
| `roundDomains` | `boolean` | `false` | `false` | Round domain values |
| `domain` | `ChartDataTypes[]` | — | — | Custom domain |
| `tickSeries` | `ReactElement` | `<LinearXAxisTickSeries />` | `<LinearYAxisTickSeries />` | Tick series component |
| `axisLine` | `ReactElement \| null` | `<LinearAxisLine />` | `<LinearAxisLine />` | Axis line (`null` to hide) |
| `visibility` | `'visible' \| 'hidden'` | — | — | Axis visibility |
| `scale` | `any` | — | — | Custom D3 scale |

## Tick Series Props

| Prop | Type | Default | Description |
|------|------|---------|-------------|
| `tickSize` | `number` | X: `75`, Y: `30` | Spacing between ticks |
| `interval` | `number \| TimeInterval` | — | Custom tick interval |
| `ellipsisLength` | `number` | `18` | Max label characters before ellipsis |
| `label` | `ReactElement \| null` | `<LinearAxisTickLabel />` | Tick label (`null` to hide) |
| `line` | `ReactElement \| null` | `<LinearAxisTickLine />` | Tick line (`null` to hide) |

## Tick Label Props

| Prop | Type | Default | Description |
|------|------|---------|-------------|
| `format` | `(value) => any` | — | Custom label formatter |
| `formatTooltip` | `(value) => any` | — | Tooltip format for truncated labels |
| `rotation` | `boolean \| number` | X: `true`, Y: `false` | Auto-rotate or fixed angle |
| `padding` | `number \| { fromAxis, alongAxis }` | `5` | Label padding |
| `fill` | `string` | `'#8F979F'` | Text color |
| `fontSize` | `number` | `11` | Font size |
| `fontFamily` | `string` | `'sans-serif'` | Font family |
| `align` | `'start' \| 'end' \| 'center' \| 'inside' \| 'outside'` | `'center'` | Label alignment |
| `position` | `'start' \| 'end' \| 'center'` | X: `'end'`, Y: `'start'` | Label position |
| `textAnchor` | `'start' \| 'end' \| 'middle'` | — | SVG text anchor |
| `className` | `string` | — | CSS class |
| `onClick` | `(event, data) => void` | — | Label click handler |

## Tick Line Props

| Prop | Type | Default | Description |
|------|------|---------|-------------|
| `size` | `number` | `5` | Tick line length |
| `strokeColor` | `string` | `'#8F979F'` | Line color |
| `strokeWidth` | `number` | `1` | Line thickness |
| `position` | `'start' \| 'end' \| 'center'` | X: `'end'`, Y: `'start'` | Line position |

## Axis Line Props

| Prop | Type | Default | Description |
|------|------|---------|-------------|
| `strokeColor` | `string` | `'#8F979F'` | Line color |
| `strokeWidth` | `number` | `1` | Line thickness |
| `strokeGradient` | `ReactElement<GradientProps> \| null` | — | Gradient for axis line |

## Custom Tick Formatting

```tsx
import { LinearYAxis, LinearYAxisTickSeries, LinearYAxisTickLabel } from 'reaviz';

<AreaChart
  data={data}
  yAxis={
    <LinearYAxis
      type="value"
      tickSeries={
        <LinearYAxisTickSeries
          label={
            <LinearYAxisTickLabel
              format={(v) => `$${v.toLocaleString()}`}
            />
          }
        />
      }
    />
  }
/>
```

## Hide Axis Labels (Keep Line)

```tsx
<LinearXAxis
  type="time"
  tickSeries={<LinearXAxisTickSeries label={null} />}
/>
```

## Hide Tick Lines (Keep Labels)

```tsx
<LinearYAxis
  type="value"
  tickSeries={<LinearYAxisTickSeries line={null} />}
/>
```

## Hide Entire Axis

```tsx
<AreaChart
  data={data}
  xAxis={<LinearXAxis visibility="hidden" />}
/>
```

## Remove Axis Line

```tsx
<LinearYAxis type="value" axisLine={null} />
```

## Fixed Label Rotation

```tsx
<LinearXAxisTickLabel rotation={45} />
```

## Category Axis

```tsx
<LinearXAxis type="category" />
```

## Time Axis with Custom Interval

```tsx
import { timeMonth } from 'd3-time';

<LinearXAxis
  type="time"
  tickSeries={<LinearXAxisTickSeries interval={timeMonth.every(3)} />}
/>
```

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.