Candlestick


目录

The candlestick visualization allows you to visualize data that includes a number of consistent dimensions focused on price movements, such as stock prices. The candlestick visualization includes an Open-High-Low-Close (OHLC) mode, as well as support for additional dimensions based on time series data.

Candlestick visualizations build upon the foundation of the time series visualization and include many common configuration settings.

You can use a candlestick if you want to visualize, at a glance, how a price moved over time, whether it went up, down, or stayed the same, and how much it fluctuated:

{{< figure src="/media/docs/grafana/panels-visualizations/screenshot-candlestick-v11.6.png" max-width="750px" alt="A candlestick visualization" >}}

Each candlestick is represented as a rectangle, referred to as the candlestick body. The candlestick body displays the opening and closing prices during a time period. Green candlesticks represent when the price appreciated while the red candlesticks represent when the price depreciated. The lines sticking out the candlestick body are referred to as wicks or shadows, which represent the highest and lowest prices during the time period.

Use a candlestick when you need to:

Configure a candlestick

Once you’ve created a dashboard, the following video shows you how to configure a candlestick visualization:

{{< youtube id="IOFKBgbf3aM" >}}

{{< docs/play title="Candlestick" url="https://play.grafana.org/d/candlestick/candlestick" >}}

Supported data formats

The candlestick visualization works best with price movement data for an asset. The data must include:

Example

Timestamps Open High Low Close
2024-03-13 10:05:00 0.200 0.205 0.201 0.203
2024-03-14 10:10:10 0.204 0.205 0.201 0.200
2024-03-15 10:15:10 0.204 0.205 0.201 0.200
2024-03-16 10:20:11 0.203 0.203 0.202 0.203
2024-03-17 10:25:11 0.203 0.203 0.202 0.203
2024-03-18 10:30:12 0.202 0.202 0.201 0.201

The data is converted as follows:

{{< figure src="/media/docs/grafana/panels-visualizations/screenshot-candles-volume-v11.6.png" max-width="750px" alt="A candlestick visualization showing the price movements of specific asset." >}}

Pan and zoom panel time range

{{< docs/shared lookup="visualizations/panel-pan-zoom.md" source="grafana" version="<GRAFANA_VERSION>" >}}

Configuration options

{{< docs/shared lookup="visualizations/config-options-intro.md" source="grafana" version="<GRAFANA_VERSION>" >}}

Panel options

{{< docs/shared lookup="visualizations/panel-options.md" source="grafana" version="<GRAFANA_VERSION>" >}}

Candlestick options

The following options let you control which data is displayed in the visualization and how it appears:

Option Description
Mode Controls which dimensions are used for the visualization. Choose from:
  • Candles - Uses the open, high, low, and close dimensions.
  • Volume - Uses only the volume dimension.
  • Both - The default behavior, which displays both candles and volume values.
Candle style Controls the appearance of the candles. Choose from:
  • Candles - The default display style, which creates candle-style markers between the open and close dimensions.
  • OHLC Bars - Displays values for the four core dimensions, open, high, low, and close.
This option is hidden when Mode is Volume.
Color strategy Controls how colors are applied to dimensions. Choose from:
  • Since Open - This mode uses the Up color if the intra-period price movement is positive.
  • Since Prior Close - The color of the candle is based on the inter-period price movement or change in value.
Up color/Down color These options control which colors are used when the price movement is up or down. Note that the Color strategy selection determines if intra-period or inter-period price movement is used to select the candle or OHLC bar color.
Open, High, Low, Close, Volume The candlestick visualization attempts to map fields from your data to these dimensions, as appropriate dimension.
Additional fields The Include and Ignore options allow the candlestick visualization to display other included data such as simple moving averages, Bollinger bands and more, using the same styles and configurations available in the time series visualization.

Color strategy

The Color strategy option controls how colors are applied to dimensions. Choose from:

Open, High, Low, Close, Volume {#open-high-low-close}

The candlestick visualization attempts to map fields from your data to the appropriate dimension:

In Volume mode, the High and Low field pickers are hidden. In Candles mode, the Volume field picker is hidden. Both mode shows all pickers.

{{< admonition type="note" >}} The candlestick visualization legend doesn't display these values. {{< /admonition >}}

If your data can't be mapped to these dimensions for some reason (for example, because the column names aren't the same), you can map them manually using the Open, High, Low, and Close fields under the Candlestick options in the panel editor:

{{< figure src="/media/docs/grafana/panels-visualizations/screenshot-olhc-options-v11.6.png" max-width="400px" alt="Open, High, Low, and Close fields in the panel editor" >}}

Additional fields

The candlestick visualization is based on the time series visualization, and it can visualize additional data dimensions beyond open, high, low, close, and volume. The Include and Ignore options allow it to visualize other included data such as simple moving averages, Bollinger bands and more, using the same styles and configurations available in the time series visualization.

Tooltip options

Tooltip options control the information overlay that appears when you hover over data points in the visualization.

Option Description
Tooltip mode When you hover your cursor over the visualization, Grafana can display tooltips. Choose how tooltips behave.
Values sort order This option controls the order in which values are listed in a tooltip.
Hover proximity Set the hover proximity (in pixels) to control how close the cursor must be to a data point to trigger the tooltip to display.
Max width Set the maximum width of the tooltip box.
Max height Set the maximum height of the tooltip box. The default is 600 pixels.

Tooltip mode

When you hover your cursor over the visualization, Grafana can display tooltips. Choose how tooltips behave.

Use an override to hide individual series from the tooltip.

Values sort order

When you set the Tooltip mode to All, the Values sort order option is displayed. This option controls the order in which values are listed in a tooltip. Choose from the following:

Hover proximity

Set the hover proximity (in pixels) to control how close the cursor must be to a data point to trigger the tooltip to display. The following screen recording shows this option in a time series visualization:

Adding a hover proximity limit for tooltips

Legend options

{{< docs/shared lookup="visualizations/legend-options-1.md" source="grafana" version="<GRAFANA_VERSION>" >}}

Annotation options

{{< docs/shared lookup="visualizations/annotations/options.md" source="grafana" version="<GRAFANA_VERSION>" >}}

Graph styles options

The options under the Graph styles section let you control the general appearance of additional fields in the visualization, excluding color.

Option Description
Style Choose whether to display your time-series data as Lines, Bars, or Points.
Line interpolation Choose how the graph interpolates the series line.
Line width Set the thickness of the series lines or the outline for bars using the Line width slider.
Fill opacity Set the series area fill color using the Fill opacity slider.
Gradient mode Choose a gradient mode to control the gradient fill, which is based on the series color.
Line style Choose a solid, dashed, or dotted line style.
Connect null values Choose how null values, which are gaps in the data, appear on the graph.
Disconnect values Choose whether to set a threshold above which values in the data should be disconnected.
Show points Set whether to show data points to lines or bars.
Point size Set the size of the points, from 1 to 40 pixels in diameter.
Stack series Set whether Grafana displays series on top of each other.
Bar alignment Set the position of the bar relative to a data point.
Bar width factor Set the width of the bar relative to minimum space between data points. A factor of 0.5 means that the bars take up half of the available space between data points. A factor of 1.0 means that the bars take up all available space.

Style

Choose whether to display your time-series data as Lines, Bars, or Points. You can use overrides to combine multiple styles in the same graph. Choose from the following:

{{< figure src="/media/docs/grafana/panels-visualizations/screenshot-candle-style-v12.0.png" max-width="750px" alt="Graph styles" >}}

Line interpolation

Choose how the graph interpolates the series line:

{{< figure src="/media/docs/grafana/panels-visualizations/screenshot-candle-interpolation-v12.0.png" max-width="750px" alt="Line interpolation styles" >}}

Gradient mode

Choose a gradient mode to control the gradient fill, which is based on the series color. To change the color, use the standard color scheme field option. For more information, refer to Color scheme.

Gradient appearance is influenced by the Fill opacity setting. The following image shows the Fill opacity set to 50.

{{< figure src="/media/docs/grafana/panels-visualizations/screenshot-candle-gradient-v12.0.png" max-width="750px" alt="Gradient modes" >}}

Scheme gradient mode

In Scheme gradient mode, the line or bar receives a gradient color defined from the selected Color scheme option in the visualization's Standard options.

The following image shows a line chart with the Green-Yellow-Red (by value) color scheme option selected:

{{< figure src="/media/docs/grafana/panels-visualizations/screenshot-candle-scheme-grad-1-v12.0.png" max-width="600px" alt="Gradient color scheme" >}}

If the Color scheme is set to From thresholds (by value) and Gradient mode is set to Scheme, then the line or bar color changes as it crosses the defined thresholds:

{{< figure src="/media/docs/grafana/panels-visualizations/screenshot-candle-scheme-grad-2-v12.0.png" max-width="600px" alt="Gradient color scheme with thresholds" >}}

Line style

Choose a solid, dashed, or dotted line style:

{{< figure src="/media/docs/grafana/panels-visualizations/screenshot-candle-line-style-v12.0.png" max-width="750px" alt="Line styles" >}}

{{< docs/shared lookup="visualizations/connect-null-values.md" source="grafana" version="<GRAFANA_VERSION>" leveloffset="+1" >}}

{{< docs/shared lookup="visualizations/disconnect-values.md" source="grafana" version="<GRAFANA_VERSION>" leveloffset="+1" >}}

To change the color, use the standard color scheme field option.

Show points

Set whether to show data points as lines or bars. Choose from the following:

Stack series

Set whether Grafana stacks or displays series on top of each other. Be cautious when using stacking because it can create misleading graphs. To read more about why stacking might not be the best approach, refer to The issue with stacking. Choose from the following:

Stack series in groups

The stacking group option is only available as an override. For more information about creating an override, refer to Configure field overrides.

  1. Edit the panel and click Overrides.

  2. Create a field override for the Stack series option.

  3. In stacking mode, click Normal.

  4. Name the stacking group in which you want the series to appear.

    The stacking group name option is only available when you create an override.

Bar alignment

Set the position of the bar relative to a data point. In the examples below, Show points is set to Always which makes it easier to see the difference this setting makes. The points don't change, but the bars change in relationship to the points. Choose from the following:

Axis options

{{< docs/shared lookup="visualizations/axis-options-2.md" source="grafana" version="<GRAFANA_VERSION>" leveloffset="+1" >}}

Standard options

{{< docs/shared lookup="visualizations/standard-options.md" source="grafana" version="<GRAFANA_VERSION>" >}}

{{< docs/shared lookup="visualizations/datalink-options-2.md" source="grafana" version="<GRAFANA_VERSION>" >}}

Value mappings

{{< docs/shared lookup="visualizations/value-mappings-options.md" source="grafana" version="<GRAFANA_VERSION>" >}}

Thresholds

{{< docs/shared lookup="visualizations/thresholds-options-1.md" source="grafana" version="<GRAFANA_VERSION>" >}}

Field overrides

{{< docs/shared lookup="visualizations/overrides-options.md" source="grafana" version="<GRAFANA_VERSION>" >}}


版本号 #3
由 壳壳虫 创建于 2026-10-31 16:36:35 UTC
由 cocobook-sync 更新于 2026-11-05 06:06:24 UTC