Charts
AreaChart
Shows a trend as a filled area under a line.
Example

Usage
Active sessions
Used like LineChart: bind data with setModel() and add another series with addSeries().
#include <FluentQt/Charts.h>
using namespace fluent::charts;
auto* chart = new AreaChart(this);
chart->setObjectName("chartPresentation");
chart->setMinimumHeight(420);
chart->setTitle("Active sessions");
chart->setSubtitle("Sessions · last 7 days");
auto* model = new ChartModel(chart);
model->setName("Primary");
const QStringList labels = {"Mon", "Mon, 04:48", "Mon, 09:36", "Mon, 14:24", "Mon, 19:12", "Tue",
"Tue, 04:48", "Tue, 09:36", "Tue, 14:24", "Tue, 19:12", "Wed", "Wed, 04:48",
"Wed, 09:36", "Wed, 14:24", "Wed, 19:12", "Thu", "Thu, 04:48", "Thu, 09:36",
"Thu, 14:24", "Thu, 19:12", "Fri", "Fri, 04:48", "Fri, 09:36", "Fri, 14:24",
"Fri, 19:12", "Sat", "Sat, 04:48", "Sat, 09:36", "Sat, 14:24", "Sat, 19:12",
"Sun"};
model->setPoints(
{{0, 27}, {1, 32}, {2, 28}, {3, 34}, {4, 30}, {5, 36}, {6, 34}, {7, 32},
{8, 41}, {9, 39}, {10, 37}, {11, 42}, {12, 46}, {13, 43}, {14, 40}, {15, 46},
{16, 42}, {17, 47}, {18, 52}, {19, 48}, {20, 54}, {21, 59}, {22, 56}, {23, 61},
{24, 57}, {25, 60}, {26, 58}, {27, 64}, {28, 59}, {29, 66}, {30, 62}},
labels);
chart->setModel(model);
auto* secondary = new ChartModel(chart);
secondary->setName("Secondary");
secondary->setPoints(
{{0, 14}, {1, 18}, {2, 16}, {3, 20}, {4, 17}, {5, 22}, {6, 20}, {7, 18},
{8, 25}, {9, 23}, {10, 22}, {11, 26}, {12, 29}, {13, 27}, {14, 25}, {15, 28},
{16, 26}, {17, 31}, {18, 34}, {19, 30}, {20, 35}, {21, 41}, {22, 38}, {23, 42},
{24, 39}, {25, 43}, {26, 40}, {27, 44}, {28, 41}, {29, 46}, {30, 43}}, labels);
chart->addSeries(secondary);import fluentqt
from PySide6.QtCore import QPointF
chart = fluentqt.AreaChart()
chart.setObjectName("chartPresentation")
chart.setMinimumHeight(420)
chart.setTitle('Active sessions')
chart.setSubtitle('Sessions · last 7 days')
model = fluentqt.ChartModel(chart)
model.setName("Primary")
values = [27, 32, 28, 34, 30, 36, 34, 32, 41, 39, 37, 42, 46, 43, 40,
46, 42, 47, 52, 48, 54, 59, 56, 61, 57, 60, 58, 64, 59, 66,
62]
labels = ['Mon', 'Mon, 04:48', 'Mon, 09:36', 'Mon, 14:24',
'Mon, 19:12', 'Tue', 'Tue, 04:48', 'Tue, 09:36',
'Tue, 14:24', 'Tue, 19:12', 'Wed', 'Wed, 04:48',
'Wed, 09:36', 'Wed, 14:24', 'Wed, 19:12', 'Thu',
'Thu, 04:48', 'Thu, 09:36', 'Thu, 14:24', 'Thu, 19:12',
'Fri', 'Fri, 04:48', 'Fri, 09:36', 'Fri, 14:24',
'Fri, 19:12', 'Sat', 'Sat, 04:48', 'Sat, 09:36',
'Sat, 14:24', 'Sat, 19:12', 'Sun']
model.setPoints(
[QPointF(i, y) for i, y in enumerate(values)],
labels
)
chart.setModel(model)
secondary = fluentqt.ChartModel(chart)
secondary.setName("Secondary")
secondary_values = [14, 18, 16, 20, 17, 22, 20, 18, 25, 23, 22, 26, 29, 27, 25,
28, 26, 31, 34, 30, 35, 41, 38, 42, 39, 43, 40, 44, 41, 46,
43]
secondary.setPoints(
[QPointF(i, y) for i, y in enumerate(secondary_values)],
labels
)
chart.addSeries(secondary)API
DeclarationNo matching API members.
fluent::charts::AreaChart
Inherits ChartView
A dedicated area chart with its own bounded renderer.
Constructors
Inherited from fluent::charts::ChartView
Properties
ChartType chartType- Read
chartType()WritesetChartType()NotifychartTypeChanged() QString title- Read
title()WritesetTitle()NotifytitleChanged() QString subtitle- Read
subtitle()WritesetSubtitle()NotifysubtitleChanged() QString valueSuffixSuffix for value readouts, for example " ms" or "%"; does not rescale data.
ReadvalueSuffix()WritesetValueSuffix()NotifyvalueSuffixChanged()QString centerText- Read
centerText()WritesetCenterText()NotifycenterTextChanged() QString centerCaption- Read
centerCaption()WritesetCenterCaption()NotifycenterCaptionChanged() bool loadingHost-controlled presentation while preparing a snapshot; owns no worker task.
ReadisLoading()WritesetLoading()NotifyloadingChanged()bool autoYRange- Read
isAutoYRange()NotifyyRangeChanged() bool legendVisible- Read
isLegendVisible()WritesetLegendVisible()NotifylegendVisibleChanged() int maximumPointCount- Read
maximumPointCount()WritesetMaximumPointCount()NotifymaximumPointCountChanged() int maximumFrameRate- Read
maximumFrameRate()WritesetMaximumFrameRate()NotifymaximumFrameRateChanged() bool autoRange- Read
isAutoRange()NotifyxRangeChanged()
Methods
void setModel(ChartModel* model)Replaces series with one borrowed model; nullptr clears.
bool addSeries(ChartModel* model)Adds a borrowed series, up to 32; duplicates are no-ops.
void setChartType(ChartType type)Changes a generic ChartView; dedicated chart components keep their fixed type.
QString valueSuffix() constSuffix for value readouts, for example " ms" or "%"; does not rescale data.
void setValueSuffix(const QString& suffix)Suffix for value readouts, for example " ms" or "%"; does not rescale data.
bool isLoading() constHost-controlled presentation while preparing a snapshot; owns no worker task.
void setLoading(bool loading)Host-controlled presentation while preparing a snapshot; owns no worker task.
void setYRange(double minimum, double maximum)Sets a finite increasing value range; percentage bars should use [0, 100].
void setMaximumPointCount(int count)Total projection budget, [512, 65536], additionally limited by viewport width.
void setMaximumFrameRate(int rate)Coalesces model update bursts at [1, 60] Hz; hidden views do no projection work.
void setXRange(double minimum, double maximum)Sets a finite increasing X viewport; invalid ranges are ignored.
void setCurrentPoint(int series, int row)Moves the data cursor without copying model data; -1 clears it.
int renderedPointCount() constNumber of cached representative points, after the last paint.
QImage exportImage(double scale = 1.0)Renders the current logical layout at a pixel scale, without cursor or focus chrome.
QByteArray exportPng(double scale = 1.0)Encodes exportImage as PNG; an empty result means failure.
QByteArray exportCsv(bool visibleRangeOnly = false) constExports original rows as UTF-8 CSV: series, name, x, y, label, unit.
void copyImage(double scale = 1.0)Copies a PNG through the host clipboard, reporting actual completion.
void copyData(bool visibleRangeOnly = false)Copies original CSV rows through the host clipboard.
Signals
void valueSuffixChanged(const QString& suffix)Suffix for value readouts, for example " ms" or "%"; does not rescale data.
void loadingChanged(bool loading)Host-controlled presentation while preparing a snapshot; owns no worker task.
void rangeActivated(int series, int first, int last)Activates the displayed half-open source range; aggregate bars/slices keep their range.
Enumerations
enum ChartTypeLineAreaBarHorizontalBarPieDonutScatterSparkline
Inherited from fluent::FluentElement
Methods
static void setTheme(Theme theme)Updates the global theme and notifies active FluentElement instances.
static void setThemeDeferred(Theme theme)Schedules a visible-first batched theme refresh without blocking the current interaction.
static Theme currentTheme()Returns the currently active global theme.
static bool themeUsesDarkAppearance(Theme theme)Returns whether a theme uses dark-backed chrome and material tokens.
static void refreshTheme()Re-broadcasts the current theme to repaint after a design-token change.
static int themeGeneration()Monotonic counter bumped on every theme change, for staleness checks.
Theme effectiveTheme() constResolves the theme used by this element, honoring an inherited QWidget override.
bool effectiveThemeUsesDarkAppearance() constReturns whether this element's effective theme uses dark-backed chrome.
bool setThemeOverrides(const QJsonObject& overrides)Component-facing token accessors.
QJsonObject themeOverrides() constReturns this element's authored overrides.
void clearThemeOverrides()Restores all token fields to global theme defaults.
const Colors& themeColorsRef() constNon-copying access to the active color set (for hot paint paths).
Material::AcrylicToken themeAcrylic() constMaterial, elevation, and adaptive layout tokens.
QColor themeBackdrop(bool active) constWindow-chrome backdrop color for the given activation state.
virtual void onThemeUpdated()Called after the global theme changes.
Enumerations
enum ThemeGlobal visual theme used when resolving design tokens.
Light = 0Dark = 1HighContrast = 2
Types and aliases
struct ColorsDesign token snapshots returned to components.
Inherited from fluent::QMLPlus
Methods
AnchorLayout::Anchors* anchors()Returns mutable anchors for the QWidget host.
void setState(const QString& name)Applies a named state, or clears state when name is empty.
void addState(const QMLState& state)Registers or replaces a named state definition.
void evaluateStates()Reevaluates conditions; the first registered true condition wins.
QMLPlusRuntime* runtime()Returns the lazy host-owned state observation object.
void setAnchors(const AnchorLayout::Anchors& anchors)Replaces all host anchors and invalidates the parent layout.
void resetAnchors()Clears all host anchors and invalidates the parent layout.
void bind(const char* targetProp, QObject* source, const char* sourceProp, PropertyBinder::Direction dir = PropertyBinder::OneWay)Binds a source property to a property on the QWidget host.
BindingHandle bindManaged(const char* targetProp, QObject* source, const char* sourceProp, PropertyBinder::Direction direction = PropertyBinder::OneWay, BindingOptions options = {})Installs a managed direct binding on this QWidget host.
BindingHandle bindComputed(const char* targetProp, const QVector<BindingDependency>& dependencies, std::function<QVariant()> evaluate, BindingOptions options = {})Installs an explicit-dependency C++ expression on this QWidget host.
void addTransition(const StateTransition& transition)Registers a state transition in precedence order.
void setBehavior(const char* propertyName, const PropertyAnimation& animation)Sets the default animation for this host's managed property writes.
void clearBehavior(const char* propertyName)Removes the default animation for future managed writes.
bool writeProperty(const char* propertyName, const QVariant& value)Writes a host property through Behavior without removing its binding.
All inherited Qt members:QWidget