• /
  • Log in
  • Free account

JsonChart

Creates a json 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 { JsonChart } from 'nr1'

Examples

Basic

ReferenceError: JsonChart is not defined

Fill container

ReferenceError: JsonChart is not defined

With custom data

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.

Example 1

1
const data = {
2
id: 1,
3
name: 'Foo',
4
price: 123,
5
tags: ['Bar', 'Eek'],
6
stock: {
7
warehouse: 300,
8
retail: 20,
9
},
10
};
fullHeightboolean
DEFAULT
false

Expands the chart to occupy all available height.

fullWidthboolean
DEFAULT
false

Expands the chart to occupy all available width.

querystring

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

styleobject

Inline style for custom styling.

Methods

JsonChart.render

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