The open and composable observability and data visualization platform. Visualize metrics, logs, and traces from multiple sources like Prometheus, Loki, Elasticsearch, InfluxDB, Postgres and many more.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
grafana/public/app/plugins/panel/candlestick/models.gen.ts

74 lines
1.8 KiB

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// NOTE: This file will be auto generated from models.cue
// It is currenty hand written but will serve as the target for cuetsy
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
import { LegendDisplayMode, OptionsWithLegend } from '@grafana/schema';
export const modelVersion = Object.freeze([1, 0]);
export enum VizDisplayMode {
CandlesVolume = 'candles+volume',
Candles = 'candles',
Volume = 'volume',
}
export enum CandleStyle {
Candles = 'candles',
OHLCBars = 'ohlcbars',
}
export enum ColorStrategy {
// up/down color depends on current close vs current open
// filled always
OpenClose = 'open-close',
// up/down color depends on current close vs prior close
// filled/hollow depends on current close vs current open
CloseClose = 'close-close',
}
export interface CandlestickFieldMap {
open?: string;
high?: string;
low?: string;
close?: string;
volume?: string;
}
export interface CandlestickColors {
up: string;
down: string;
flat: string;
}
export const defaultColors: CandlestickColors = {
up: 'green',
down: 'red',
flat: 'gray',
};
export interface CandlestickOptions extends OptionsWithLegend {
mode: VizDisplayMode;
candleStyle: CandleStyle;
colorStrategy: ColorStrategy;
fields: CandlestickFieldMap;
colors: CandlestickColors;
// When enabled, all fields will be sent to the graph
includeAllFields?: boolean;
}
export const defaultOptions: CandlestickOptions = {
mode: VizDisplayMode.CandlesVolume,
candleStyle: CandleStyle.Candles,
colorStrategy: ColorStrategy.OpenClose,
colors: defaultColors,
fields: {},
legend: {
displayMode: LegendDisplayMode.List,
showLegend: true,
placement: 'bottom',
calcs: [],
},
includeAllFields: false,
};