agentsclimarketplace

Bar chart

Skill reaviz/skills/reaviz/charts/bar-chart

AI Skills for Reaviz Projects

Install
npx -y skills add reaviz/skills --skill bar-chart

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

2 things to look at

  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
  • 4 stars4 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

SKILL.md

9.4 KB, as published. Nobody here has run it

BarChart

Bar chart with gradient fills, labels, and range lines. Supports vertical/horizontal layout with standard, grouped, stacked, stacked-normalized, stacked-diverging, marimekko, waterfall, and histogram variants.

Import

import {
  BarChart,
  BarSeries,
  Bar,
  BarLabel,
  GuideBar,
  RangeLines,
  BarTargetMarker,
  StackedBarChart,
  StackedBarSeries,
  StackedNormalizedBarChart,
  StackedNormalizedBarSeries,
  MarimekkoChart,
  MarimekkoBarSeries,
  HistogramBarChart,
  HistogramBarSeries
} from 'reaviz';

BarChart Props

PropTypeDefaultDescription
dataChartDataShape[][]Chart data
widthnumberautoWidth in pixels
heightnumberautoHeight in pixels
marginsMarginsChart margins
seriesReactElement<BarSeriesProps><BarSeries />Series component
xAxisReactElement<LinearAxisProps><LinearXAxis type="category" />X axis component
yAxisReactElement<LinearAxisProps><LinearYAxis type="value" />Y axis component
gridlinesReactElement | null<GridlineSeries />Gridlines (null to hide)
brushReactElement | nullnullBrush selection component
secondaryAxisReactElement[]Additional axis components
classNamestringSVG CSS class
containerClassNamestringContainer div CSS class

BarSeries Props

PropTypeDefaultDescription
typeBarType'standard'Chart type (see variants below)
layout'vertical' | 'horizontal''vertical'Bar direction
animatedbooleantrueEnable animations
colorSchemeColorSchemeType'cybertron'Color scheme name or function
paddingnumber0.1Padding between bars
groupPaddingnumber16Padding between groups
barBarElement | BarElement[]<Bar />Bar element(s)
tooltipReactElement | null<TooltipArea />Tooltip component
valueMarkersReactElement<LinearValueMarkerProps>[] | nullReference lines at specific values
binSizenumberSize of each bin for histogram data

Bar Props

PropTypeDefaultDescription
gradientReactElement<GradientProps> | null<Gradient />Gradient fill
maskReactElement<MaskProps> | nullSVG pattern mask
rxnumber0Horizontal corner radius
rynumber0Vertical corner radius
cursorstring'auto'CSS cursor on hover
minHeightnumberMinimum bar height
activeBrightnessnumber0.5Brightness increase on hover
glowGlowGlow effect
labelReactElement<BarLabelProps> | nullnullValue label on bar
guideReactElement<GuideBarProps> | nullnullBackground guide bar
rangeLinesReactElement<RangeLinesProps> | nullnullRange indicator lines
targetMarkerReactElement<BarTargetMarkerProps> | null<BarTargetMarker />Target/goal marker
tooltipReactElement<ChartTooltipProps> | nullPer-bar tooltip
onClick(event: ClickEvent) => voidClick handler
onMouseEnter(event) => voidMouse enter handler
onMouseLeave(event) => voidMouse leave handler

BarLabel Props

PropTypeDefaultDescription
position'top' | 'center' | 'bottom''top'Label placement
fillstring'#000'Text color
fontSizenumber13Font size
fontFamilystring'sans-serif'Font family
paddingnumber5Label padding from bar edge
classNamestringCSS class

GuideBar Props

PropTypeDefaultDescription
fillstring'#eee'Guide bar fill color
opacitynumber0.15Guide bar opacity

RangeLines Props

PropTypeDefaultDescription
position'top' | 'bottom''top'Line placement
strokeWidthnumber1Line thickness
colorstringLine color

BarTargetMarker Props

PropTypeDefaultDescription
fillstring'#fff'Target line color
positiveDeltaFillstring'#00C49F'Color when above target
negativeDeltaFillstring'#FF7361'Color when below target
targetStrokeWidthnumber2Target line thickness
deltaStrokeWidthnumber1Delta line thickness

Basic Usage

Single Series (Vertical)

const data = [
  { key: 'DLP', data: 13 },
  { key: 'SIEM', data: 2 },
  { key: 'Tic', data: 7 },
];

<BarChart
  width={350}
  height={250}
  data={data}
/>

Horizontal Layout

<BarChart
  width={350}
  height={250}
  data={data}
  xAxis={<LinearXAxis type="value" />}
  yAxis={<LinearYAxis type="category" />}
  series={<BarSeries layout="horizontal" />}
/>

Grouped Multi-Series

const data = [
  { key: 'Q1', data: [
    { key: 'Sales', data: 10 },
    { key: 'Revenue', data: 15 },
  ]},
  { key: 'Q2', data: [
    { key: 'Sales', data: 25 },
    { key: 'Revenue', data: 20 },
  ]},
];

<BarChart
  width={550}
  height={350}
  data={data}
  series={<BarSeries type="grouped" colorScheme="cybertron" />}
/>

Stacked

<StackedBarChart
  width={550}
  height={350}
  data={multiSeriesData}
  series={<StackedBarSeries colorScheme="cybertron" />}
/>

Stacked Normalized (Percentage)

<StackedNormalizedBarChart
  width={550}
  height={350}
  data={multiSeriesData}
  series={<StackedNormalizedBarSeries colorScheme="cybertron" />}
/>

Marimekko

<MarimekkoChart
  width={550}
  height={350}
  data={multiSeriesData}
  series={<MarimekkoBarSeries colorScheme="cybertron" />}
/>

Histogram

<HistogramBarChart
  width={550}
  height={350}
  data={data}
  series={<HistogramBarSeries binSize={25} />}
/>

Customization

Rounded Corners

<BarChart
  data={data}
  series={<BarSeries bar={<Bar rx={4} ry={4} />} />}
/>

Bar Labels

<BarChart
  data={data}
  series={
    <BarSeries
      bar={<Bar label={<BarLabel position="top" fill="#333" />} />}
    />
  }
/>

Guide Bars (Hover Background)

<BarChart
  data={data}
  series={
    <BarSeries
      bar={<Bar guide={<GuideBar />} />}
    />
  }
/>

Range Lines

<BarChart
  data={data}
  series={
    <BarSeries
      bar={<Bar rangeLines={<RangeLines position="top" strokeWidth={3} />} />}
    />
  }
/>

Custom Gradient

import { Gradient, GradientStop } from 'reaviz';

<BarChart
  data={data}
  series={
    <BarSeries
      bar={
        <Bar
          gradient={
            <Gradient
              stops={[
                <GradientStop offset="5%" stopOpacity={0.1} />,
                <GradientStop offset="90%" stopOpacity={0.7} />,
              ]}
            />
          }
        />
      }
    />
  }
/>

Pattern Mask

import { Stripes } from 'reaviz';

<BarChart
  data={data}
  series={<BarSeries bar={<Bar mask={<Stripes />} />} />}
/>

Custom Padding

// Tighter bars
<BarSeries padding={0.05} />

// More spacing
<BarSeries padding={0.3} />

// Group spacing for grouped/stacked
<BarSeries type="grouped" groupPadding={24} />

Value Markers (Reference Lines)

import { LinearValueMarker } from 'reaviz';

<BarChart
  data={data}
  series={
    <BarSeries
      valueMarkers={[
        <LinearValueMarker value={50} color="#D740BE" />,
      ]}
    />
  }
/>

Click Handling

<BarChart
  data={data}
  series={
    <BarSeries
      bar={
        <Bar
          cursor="pointer"
          onClick={({ value, nativeEvent }) => console.log(value)}
        />
      }
    />
  }
/>

No Gridlines

<BarChart data={data} gridlines={null} />

Bar Types

TypeData ShapeDescription
'standard'ChartDataShape[]Single series bars
'grouped'ChartNestedDataShape[]Multi-series side by side
'stacked'ChartNestedDataShape[]Multi-series stacked
'stackedNormalized'ChartNestedDataShape[]Stacked to 100%
'stackedDiverging'ChartNestedDataShape[]Diverging from center
'marimekko'ChartNestedDataShape[]Proportional area (vertical only)
'waterfall'ChartDataShape[]Cumulative running total

Variant Components

ComponentDescription
BarChartBase chart — all types via type prop on series
StackedBarChartPre-configured stacked with range lines
StackedNormalizedBarChartStacked to 100% with percentage Y-axis
MarimekkoChartProportional area chart (vertical only)
HistogramBarChartHistogram with bin-based distribution
BarSeriesDefault series
StackedBarSeriesSeries pre-set to type="stacked" with range lines
StackedNormalizedBarSeriesSeries pre-set to type="stackedNormalized" with percentage tooltips
MarimekkoBarSeriesSeries pre-set to type="marimekko"
HistogramBarSeriesSeries for histogram data with range tooltips

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.