1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
4// W A R N I N G
5// -------------
6//
7// This file is not part of the Qt Chart API. It exists purely as an
8// implementation detail. This header file may change from version to
9// version without notice, or even be removed.
10//
11// We mean it.
12
13#ifndef AXISANIMATION_H
14#define AXISANIMATION_H
15
16#include <private/chartanimation_p.h>
17#include <QtCharts/private/qchartglobal_p.h>
18#include <QtCore/QPointF>
19
20QT_BEGIN_NAMESPACE
21
22class ChartAxisElement;
23
24class Q_CHARTS_PRIVATE_EXPORT AxisAnimation: public ChartAnimation
25{
26public:
27 enum Animation { DefaultAnimation, ZoomOutAnimation, ZoomInAnimation, MoveForwardAnimation, MoveBackwordAnimation};
28 AxisAnimation(ChartAxisElement *axis, int duration, QEasingCurve &curve);
29 ~AxisAnimation();
30 void setAnimationType(Animation type);
31 void setAnimationPoint(const QPointF &point);
32 void setValues(QList<qreal> &oldLayout, const QList<qreal> &newLayout);
33
34protected:
35 QVariant interpolated(const QVariant &from, const QVariant &to, qreal progress) const override;
36 void updateCurrentValue(const QVariant &value) override;
37private:
38 ChartAxisElement *m_axis;
39 Animation m_type;
40 QPointF m_point;
41};
42
43QT_END_NAMESPACE
44
45
46
47#endif /* AXISANIMATION_H */
48

source code of qtcharts/src/charts/animations/axisanimation_p.h