• /
  • Log in

StackedBarChart

Creates a stacked bar chart. Data can either be obtained by performing a NRQL query against a particular account, or it can be passed through the data prop.

The data format is a series of objects, each containing metadata and data. Each data contains both values from this point, and x and y keys used to plot the chart.

Usage

import { StackedBarChart } from 'nr1'

Examples

Props

accountIdnumber

Sets the account ID to perform the query.

classNamestring

Appends class names to the component.

dataobject[]

Data is an array of objects where each object represents a series to be drawn. Each series comprises visualization metadata and an array of data points.

fullHeightboolean
DEFAULT
false

Expands the chart to occupy all available height.

fullWidthboolean
DEFAULT
false

Expands the chart to occupy all available width.

onClickStackedBarfunction

Adds a click listener that gets triggered when the user clicks over the corresponding stacked bar.

function () => undefined
onHoverStackedBarfunction

Adds a hover listener that gets triggered when the cursor is hovered over the corresponding stacked bar.

function () => undefined
querystring

NRQL query used for fetching data. The query is performed against the provided accountId.

styleobject

Inline style for custom styling.

Methods

StackedBarChart.render

function () => undefined
Create issueEdit page
Copyright © 2021 New Relic Inc.