Generated reference › API — ICoreEssentials/UI/ICoreChartBase
kind: generated#api#icoreessentials-ui-icorechartbase

API — ICoreEssentials/UI/ICoreChartBase

The public contract of 2 header(s) under src/ICoreEssentials/UI/ICoreChartBase — 2 class/struct definition(s), 33 declaration(s). Each section shows the header's banner and its public (and protected-virtual) surface exactly as the file writes it.

HeaderDefinesDeclarationsBases
ICoreChartBase.hICoreChartAxisStyle0
ICoreChartLinePathBase.hICoreChartLinePathBase33public ICoreNativeObject

ICoreChartBase.h#

src/ICoreEssentials/UI/ICoreChartBase/ICoreChartBase.h

ICoreChartBase -- the plot item every ICore chart is built on, and the wrapper half of the chart seam: ICoreChart derives from THIS and names no toolkit type of its own.

CONVERTED BY P8.4. The toolkit's chart is Impl now, and it does NOT derive from this class. The same two consequences every converted tier states:

  • A SUBCLASS MUST OVERRIDE THE HOOKS, NEVER THE TOOLKIT VIRTUALS. A

wheelEvent() or mousePressEvent() on a subclass of this type is called by NOTHING -- no diagnostic. The wheelScrolled/mousePressed/... hooks below are the spellings that still reach the toolkit.

  • THIS TYPE IS NO LONGER A QObject. It cannot be a connect context, a

QPointer target, or a stylesheet selector. Theme subscriptions go through subscribe()'s ICoreNativeItem overload; queued work through

ICoreChartAxisStyle#

ICoreChartBase.h:51 · struct · 0 declaration(s)

The ink an axis is painted with.

struct ICoreChartAxisStyle {
public:
    ICoreColor labelColor;        // the numbers running along the ruler
    ICoreColor titleColor;
    ICoreColor lineColor;         // the rule itself and its tick marks
    ICoreColor gridColor;
    ICoreColor minorGridColor;
    bool shadesVisible = false;   // the alternating bands behind the plot
};
};

File-scope declarations#

// Which of a plot's two rulers an axis call is about. There is exactly one of
// each: the chart's own accessors assume a single horizontal and a single
// vertical axis, which is what every plot in this editor has.
enum class ICoreChartAxisSide {
    X,
    Y
};

ICoreChartLinePathBase.h#

src/ICoreEssentials/UI/ICoreChartBase/ICoreChartLinePathBase.h

ICoreChartLinePathBase -- one traced line on a plot, and the wrapper half of the line-path seam: ICoreChartLinePath derives from THIS and names no toolkit type of its own.

CONVERTED BY P8.4. The toolkit's line series is Impl now, and it does NOT derive from this class. This type is no longer a QObject: it cannot be a connect context or a QPointer target -- ICoreChartLinePathRef re-seats its liveness guard on nativeObjectHandle() for exactly that reason.

What it adds is the API a path needs spelled in ICore types -- points, the stroke, the point labels, the scatter marker -- plus one hook so a subclass never touches a toolkit signal.

The visibility/opacity/point-visibility accessors below USED to be absent on

ICoreChartLinePathBase#

ICoreChartLinePathBase.h:44 · class · bases public ICoreNativeObject · pImpl · 33 declaration(s)

class ICoreChartLinePathBase : public ICoreNativeObject {
public:
    // The Impl's QObject base, stated with its own cast in the .cpp (R2).
    ICoreNativeHandle nativeObjectHandle() const override;

    explicit ICoreChartLinePathBase(ICoreChartBase* parentChart);

    // Out of line: `Impl` must be complete where the unique_ptr's deleter is
    // instantiated.
    ~ICoreChartLinePathBase() override;

    // ---- Points ----------------------------------------------------------

    int pointCount() const;
    ICorePoint pointAt(int index) const;
    ICoreList<ICorePoint> pathPoints() const;

    // Replaces the drawn points wholesale -- one repaint rather than one per
    // point, which is what a streaming plot needs.
    void replacePoints(const ICoreList<ICorePoint>& points);

    // The tightest rectangle around the drawn points. Null when there are none.
    ICoreRect pointsBoundingBox() const;

    // ---- Identity --------------------------------------------------------

    ICoreString lineName() const;
    void setLineName(const ICoreString& name);

    // ---- Visibility and opacity ------------------------------------------
    //
    // Same names, same plain-value signatures the toolkit had, so the sites
    // that used to reach these through inheritance compile untouched.

    void setVisible(bool visible);
    bool isVisible() const;

    void setOpacity(double opacity);
    double opacity() const;

    void setPointsVisible(bool visible);
    bool pointsVisible() const;

    void setPointLabelsVisible(bool visible);
    bool pointLabelsVisible() const;

    // ---- Stroke ----------------------------------------------------------

    ICoreColor lineColor() const;
    void setLineColor(const ICoreColor& color);

    // Whole pixels, which is what the toolkit's pen carries and what the
    // saved state has always recorded -- a fractional width here would change
    // the digits that land in existing project files.
    int lineWidth() const;
    void setLineWidth(int width);

    ICorePenStyle lineStyle() const;
    void setLineStyle(ICorePenStyle style);

    ICorePenCap lineCap() const;
    void setLineCap(ICorePenCap cap);

    ICorePenJoin lineJoin() const;
    void setLineJoin(ICorePenJoin join);

    // ---- Point labels ----------------------------------------------------

    ICoreColor labelsColor() const;
    void setLabelsColor(const ICoreColor& color);

    ICoreFont labelsFont() const;
    void setLabelsFont(const ICoreFont& font);

    // ---- Scatter ---------------------------------------------------------

    // Draws each point as a marker of the given shape and size (in pixels).
    // `keepConnectingLine` false leaves a pure scatter; true overlays markers
    // on a normal line plot.
    //
    // Implemented with the toolkit's light-marker path rather than a scatter
    // series on purpose: everything around a path -- the chart's side panel,
    // CSV export, state save/restore, bounds tracking -- is typed to the line
    // path, so a second series class would need every one of them widened
    // before a scatter path behaved like a first-class path.
    //
    // The line is drawn with the series pen, so removing the pen is what turns
    // this into a pure scatter. The colour is still set either way, so the
    // legend entry and the side panel's swatch match the markers.
    void setPointMarker(ICoreChartMarkerShape shape, const ICoreColor& color,
                        double markerSizePx, bool keepConnectingLine);

protected:
    // The user clicked the path; `point` is the press location ON the path, in
    // plot coordinates. Subscribed once against the Impl, so a subclass
    // overrides this instead of touching a toolkit signal.
    virtual void pointClicked(const ICorePoint& point);

private:
    class Impl;                    // the two-line residue; state lives here
    std::unique_ptr<Impl> impl;
};

File-scope declarations#

// How a path's points are drawn when it is a scatter rather than a signal.
enum class ICoreChartMarkerShape {
    Circle,
    Cross,
    Square,
    Diamond
};