Menu
Scroll for more
Important: This documentation is about an older version. It's relevant only to the release noted, many of the features and functions have been updated or replaced. Please view the current version.
Enterprise
Open source
GraphNG class
“Time as X” core component, expects ascending x
Signature
typescript
export declare class GraphNG extends React.Component<GraphNGProps, GraphNGState> Import
typescript
import { GraphNG } from '@grafana/ui';Constructors
| Constructor | Modifiers | Description |
|---|---|---|
| constructor(props) | Constructs a new instance of the GraphNG class |
Properties
| Property | Modifiers | Type | Description |
|---|---|---|---|
| contextType | static | React.Context<PanelContext> | |
| getTimeRange | () => TimeRange | ||
| panelContext | PanelContext |
Methods
constructor(props)
Constructs a new instance of the GraphNG class
Signature
typescript
constructor(props: GraphNGProps);Parameters
| Parameter | Type | Description |
|---|---|---|
| props | GraphNGProps |
contextType property
Signature
typescript
static contextType: React.Context<PanelContext>;getTimeRange property
Signature
typescript
getTimeRange: () => TimeRange;panelContext property
Signature
typescript
panelContext: PanelContext;componentDidMount method
Signature
typescript
componentDidMount(): void;Returns:
void
componentDidUpdate method
Signature
typescript
componentDidUpdate(prevProps: GraphNGProps): void;Parameters
| Parameter | Type | Description |
|---|---|---|
| prevProps | GraphNGProps |
Returns:
void
componentWillUnmount method
Signature
typescript
componentWillUnmount(): void;Returns:
void
handleCursorUpdate method
Signature
typescript
handleCursorUpdate(evt: DataHoverEvent | LegacyGraphHoverEvent): void;Parameters
| Parameter | Type | Description |
|---|---|---|
| evt | DataHoverEvent | LegacyGraphHoverEvent |
Returns:
void
prepState method
Signature
typescript
prepState(props: GraphNGProps, withConfig?: boolean): GraphNGState;Parameters
| Parameter | Type | Description |
|---|---|---|
| props | GraphNGProps | |
| withConfig | boolean |
Returns:
GraphNGState
render method
Signature
typescript
render(): JSX.Element | null;Returns:
JSX.Element | null
Was this page helpful?
Related resources from Grafana Labs
Additional helpful documentation, links, and articles:
Video

Getting started with managing your metrics, logs, and traces using Grafana
In this webinar, we’ll demo how to get started using the LGTM Stack: Loki for logs, Grafana for visualization, Tempo for traces, and Mimir for metrics.
Video

Getting started with Grafana dashboard design
In this webinar, you'll learn how to design stylish and easily accessible Grafana dashboards that tell a story.
Video

Building advanced Grafana dashboards
In this webinar, we’ll demo how to build and format Grafana dashboards.