Skip to main content

FibonacciCirclesAnnotation

FibonacciCirclesAnnotationšŸ“˜ draws concentric Fibonacci circles or ovals from two placed points. The points are opposite corners of the rectangle that contains the threshold 1 oval; every other threshold scales that oval from the same center.

const { NumberRange, NumericAxis, SciChartSurface } = SciChart;
const {
EFibonacciLabelColorMode,
EFibonacciLabelPlacement,
FibonacciCirclesAnnotation,
EAnnotationVisibilityMode,
SciTraderLightTheme
} = SciChartFinancialTools; // if using npm, import from "scichart-financial-tools";

const { wasmContext, sciChartSurface } = await SciChartSurface.create(divElementId, {
theme: new SciTraderLightTheme()
});

sciChartSurface.xAxes.add(new NumericAxis(wasmContext, { visibleRange: new NumberRange(0, 100) }));
sciChartSurface.yAxes.add(new NumericAxis(wasmContext, { visibleRange: new NumberRange(0, 1000) }));

sciChartSurface.annotations.add(
new FibonacciCirclesAnnotation({
// The two points are opposite corners of the threshold 1 oval.
points: [
{ x: 40, y: 390 },
{ x: 61, y: 610 },
],
thresholds: [
0, 0.236, 0.5, 0.618, 1, 1.618, 2.618, 3.618, 4.236
],
regionColors: [
"rgb(223,72,76)", // used for both strokes & fills of this annotation
"rgb(231,147,46)",
"rgb(68,151,130)",
"rgb(103,173,92)",
"rgb(85,185,209)",
"rgb(128,128,128)",
"rgb(214,56,101)",
"rgb(56,97,246)",
],
fillOpacity: 0.20,
strokeThickness: 2,
fibonacciLabelPlacement: EFibonacciLabelPlacement.Top,
// fibonacciLabelColorMode: EFibonacciLabelColorMode.SingleColor,
// fibonacciLabelColor: "#000000", // only important if `fibonacciLabelColorMode` is `Single`
fibonacciLabelLinePadding: 0,
formatFibonacciLabel: ({ thresholdLabel }) => thresholdLabel + "%",
isEditable: true,
gripVisibility: EAnnotationVisibilityMode.Always
})
);

Use this variant when the key relationship is distance around a central consolidation or swing. The shared thresholdsšŸ“˜, regionColorsšŸ“˜, fillOpacityšŸ“˜ and Fibonacci label properties are inherited from FibonacciAnnotationBase.

See Also​