Histogram

histogram

<Histogram
    data={query_name} 
    x=column_x 
/>

Examples

Histogram

histogram

<Histogram 
    data={complaints_by_day_dept} 
    x=complaints 
    xAxisTitle="Daily Calls"
/>

Options

Data

Required

Query name, wrapped in curly braces

Options:
query name
Required

Column which contains the data you want to summarize

Options:
column name

Sets behaviour for empty datasets. Can throw an error, a warning, or allow empty. When set to 'error', empty datasets will block builds in build:strict. Note this only applies to initial page load - empty datasets caused by input component changes (dropdowns, etc.) are allowed.

Default:
error

Text to display when an empty dataset is received - only applies when emptySet is 'warn' or 'pass', or when the empty dataset is a result of an input component change (dropdowns, etc.).

Options:
string
Default:
No records

Formatting & Styling

Format to use for x column (see available formats)

Options:
Excel-style format | built-in format name | custom format name

Color to override default series color

Options:
CSS name | hexademical | RGB | HSL

% of the full color that should be rendered, with remainder being transparent

Options:
number (0 to 1)
Default:
1

Array of custom colours to use for the chart. E.g., {['#cf0d06','#eb5752','#e88a87']}

Options:
array of color strings (CSS name | hexademical | RGB | HSL)
Default:
built-in color palette

Axes

Name to show under x-axis. If 'true', formatted column name is used. Only works with swapXY=false

Default:
false

Name to show beside y-axis. If 'true', formatted column name is used.

Default:
false

Turns on/off gridlines extending from x-axis tick marks (vertical lines when swapXY=false)

Options:
Default:
false

Turns on/off gridlines extending from y-axis tick marks (horizontal lines when swapXY=false)

Options:
Default:
true

Turns on/off value labels on the x-axis

Options:
Default:
true

Turns on/off value labels on the y-axis

Options:
Default:
true

Turns on/off thick axis line (line appears at y=0)

Options:
Default:
true

Turns on/off thick axis line (line appears directly alongside the y-axis labels)

Options:
Default:
false

Turns on/off tick marks for each of the x-axis labels

Options:
Default:
false

Turns on/off tick marks for each of the y-axis labels

Options:
Default:
false

Starting value for the y-axis

Options:
number

Maximum value for the y-axis

Options:
number

Chart

Chart title. Appears at top left of chart.

Options:
string

Chart subtitle. Appears just under title.

Options:
string

Turns legend on or off. Legend appears at top center of chart.

Options:
Default:
true for multiple series

Minimum height of the chart area (excl. header and footer) in pixels. Adjusting the height affects all viewport sizes and may impact the mobile UX.

Options:
number
Default:
180
Whether to show the download button to allow users to download the data
Options:
Default:
true
Whether to show the button to allow users to save the chart as an image
Options:
Default:
true

Which chart renderer type (canvas or SVG) to use. See ECharts' documentation on renderers.

Options:
Default:
canvas

Custom Echarts Options

Custom Echarts options to override the default options. See reference page for available options.

Options:
{{exampleOption:'exampleValue'}}

Custom Echarts options to override the default options for all series in the chart. This loops through the series to apply the settings rather than having to specify every series manually using echartsOptions See reference page for available options.

Options:
{{exampleSeriesOption:'exampleValue'}}

Helper prop for custom chart development - inserts a code block with the current echarts config onto the page so you can see the options used and debug your custom options

Options:
Default:
false

Interactivity

Group name to connect this chart to other charts for synchronized tooltip hovering. Charts with the same connectGroup name will become connected

Annotations

Histograms can include annotations using the ReferenceLine and ReferenceArea components. These components are used within a chart component like so:

<Histogram data={sales_data} x=category>
  <ReferenceLine y=20/>
  <ReferenceArea xMin=3 xMax=8/>
</Histogram>