@rekurt/openkline - v0.2.0
    Preparing search index...

    Class CompareController

    C2 public entry point. Manages a set of CompareSeries overlaid on a chart, materializing each as a ComparePrimitive attached through the host's primitive framework. Constructed explicitly by the host (new CompareController(chart)), which is precisely why compare mode adds nothing to the base bundle: the base chart never references this class.

    Usage:

    import { CompareController } from '@rekurt/openkline-core';
    const compare = new CompareController(chart);
    compare.add({ id: 'ETH', color: '#8884', points, normalization: 'percentage' });
    // ...
    compare.remove('ETH');
    compare.clear();

    All 'percentage'/'indexed' series share one self-scaling normalized Y axis (see CompareScale) so the lines are mutually comparable.

    Index

    Constructors

    Methods

    Constructors

    Methods

    • Add (or replace, by id) a compare series and attach its primitive. A duplicate id swaps the series payload in place — the old primitive is detached first so the chart never carries two lines for one symbol. The host repaints via attachPrimitive.

      Parameters

      Returns void

    • Remove a compare series by id and detach its primitive. Returns true if a series with that id existed.

      Parameters

      • id: string

      Returns boolean

    • Update an existing series' points/color/normalization in place (matched by id) and repaint. Returns true if the series existed. Cheaper than remove+add — it reuses the attached primitive instead of detaching it.

      Parameters

      Returns boolean