Qt | QChartView+QDateTimeAxis(日期和时间数据图表)+QPieSeries(饼图)

2024-08-02 22:18:18 浏览数 (1)

点击上方"蓝字"关注我们

01、QDateTimeAxis

QDateTimeAxis 是 Qt 中用于图表的轴类,它专门用于处理日期和时间数据。这个类允许你在图表上显示和解释与日期和时间相关的数据点。例如,在 Qt 的图表库中,你可以使用 QDateTimeAxis 来创建一个时间序列图表,展示股票价格、天气数据或其他随时间变化的数据。

02、QValueAxis

QValueAxis 是 Qt 中用于图表的另一个轴类,它用于表示数值数据。这个类允许你在图表上显示和解释数值数据点。QValueAxis 可以用于各种类型的图表,如柱状图、折线图和散点图等,以展示不同类别的数据值。

03、QChartView

QChartView 是 Qt 中的一个类,用于展示 QChart 对象。QChart 是一个高级图表组件,它可以包含多种类型的图表,如折线图、柱状图、饼图等,并且支持多种数据系列和数据点。QChartView 提供了一个视图,使得 QChart 可以被嵌入到图形用户界面(GUI)中,以便用户可以交互式地查看和分析数据。

04、.pro

代码语言:javascript复制
QT  = charts
​
SOURCES  = 
    main.cpp
​
RESOURCES  = 
    sundata.qrcQT  = charts
​
SOURCES  = 
    main.cpp
​
RESOURCES  = 
    sundata.qrc

05、main.cpp

代码语言:javascript复制
#include <QtWidgets/QApplication>
#include <QtWidgets/QMainWindow>
​
#include <QtCharts/QChartView>
#include <QtCharts/QLineSeries>
#include <QtCore/QDateTime>
#include <QtCharts/QDateTimeAxis>
#include <QtCore/QFile>
#include <QtCore/QTextStream>
#include <QtCore/QDebug>
#include <QtCharts/QValueAxis>
​
#include <QStringList>
​
//QT_CHARTS_USE_NAMESPACE
​
int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
​
    //![1]
    QLineSeries *series = new QLineSeries();
    //![1]
​
    //![2]已文件的存储
    QFile sunSpots(":sun");
    if (!sunSpots.open(QIODevice::ReadOnly | QIODevice::Text)) {
        return 1;
    }
​
    QTextStream stream(&sunSpots);
    while (!stream.atEnd()) {
        QString line = stream.readLine();
        if (line.startsWith("#") || line.startsWith(":"))
            continue;
        QStringList values = line.split(" ", Qt::SkipEmptyParts); // 分割 跳过多余空格
        QDateTime momentInTime;
        momentInTime.setDate(QDate(values[0].toInt(), values[1].toInt() , 15)); // 年 月 日
        series->append(momentInTime.toMSecsSinceEpoch(), values[2].toDouble());
    }
    sunSpots.close();
    //![2]
​
    //![3]
    QChart *chart = new QChart();
    chart->addSeries(series);
    chart->legend()->hide();
    chart->setTitle("太阳黑子数量(根据太空天气预报中心)");
    //![3]
​
    //![4]将日期和时间添加到图表的轴上
    QDateTimeAxis *axisX = new QDateTimeAxis;
    axisX->setTickCount(10); // 设置网格竖线数量
    axisX->setFormat("MMM yyyy"); // 月 年
    axisX->setTitleText("日期");
    chart->addAxis(axisX, Qt::AlignBottom);
    series->attachAxis(axisX);
​
    QValueAxis *axisY = new QValueAxis;
    axisY->setLabelFormat("%i");
    axisY->setTitleText("太阳黑子计数");
    chart->addAxis(axisY, Qt::AlignLeft);
    series->attachAxis(axisY);
    //![4]
​
    //![5]
    QChartView *chartView = new QChartView(chart);
    chartView->setRenderHint(QPainter::Antialiasing);
    //![5]
​
    //![6]
    QMainWindow window;
    window.setCentralWidget(chartView);
    window.resize(820, 600);
    window.show();
    //![6]
​
    return a.exec();
}
​

06、sun_spots.txt

代码语言:javascript复制
::Recent_Solar_Indices: RecentIndices.txt
:Created: 2012 Aug 06 0759 UTC
# Prepared by the U.S. Dept. of Commerce, NOAA, Space Weather Prediction Center (SWPC).
# Please send comments and suggestions to swpc.webmaster@noaa.gov
#
# Source SWO: SWPC Space Weather Operations (SWO).
# Source RI: S.I.D.C. Brussels International Sunspot Number.
# Source 10.7cm radio flux values (sfu): Penticton, B.C., Canada.
# 
# Source Ap: GeoForschungsZentrum, Postdam, Germany
#            Prior to January 1997, Institut fur Geophysik, Gottingen, Germany
# Source Ap for final month is NOAA/SWPC estimated Ap.
#
# Data not yet available or not calculable: -1.0
#
# Values for most recent 6 months are considered preliminary. 
# Final values from National Geophysical Data Center www.ngdc.noaa.gov
#
#                               Recent Solar Indices
#                         of Observed Monthly Mean Values
#
#       -----------Sunspot Numbers--------- ----Radio Flux---  ---Geomagnetic---
#       ---Observed---- Ratio   --Smoothed- Observed Smoothed  Observed Smoothed
# YR MO    SWO     RI   RI/SW    SWO   RI     10.7cm  10.7cm      Ap       Ap
#-------------------------------------------------------------------------------
1991 01   213.5   136.9  0.64   220.5 147.6    229.4    205.5         8     17.4
1991 02   270.2   167.5  0.62   221.5 147.6    243.0    206.3        10     18.4
1991 03   227.9   141.9  0.62   220.7 146.6    230.0    205.9        27     19.1
1991 04   215.9   140.0  0.65   220.7 146.5    198.8    206.8        17     20.0
1991 05   182.5   121.3  0.66   219.6 145.5    190.3    207.1        18     21.7
1991 06   231.8   169.7  0.73   218.9 145.2    206.8    207.4        44     23.0
1991 07   245.7   173.7  0.71   219.5 146.3    212.0    207.7        27     23.6
1991 08   251.5   176.3  0.70   218.3 146.6    210.3    206.8        30     24.7
1991 09   185.8   125.3  0.67   214.2 144.9    180.6    203.9        20     25.0
1991 10   220.1   144.1  0.65   208.4 141.7    201.3    199.7        31     24.3
1991 11   169.0   108.2  0.64   202.2 138.1    172.0    195.4        33     24.1
1991 12   217.7   144.4  0.66   193.7 131.7    223.9    188.9        15     23.0
1992 01   217.9   150.0  0.69   183.3 123.7    217.6    181.8        14     21.1
1992 02   238.2   161.1  0.68   171.8 115.4    232.1    174.8        31     19.8
1992 03   160.5   106.7  0.66   161.6 108.2    171.3    168.5        14     19.4
1992 04   144.0    99.8  0.69   154.3 103.3    158.5    162.9        11     18.9
1992 05   106.3    73.8  0.69   148.9 100.3    125.4    158.9        21     17.5
1992 06   104.7    65.2  0.62   143.3  97.1    116.7    154.3        15     16.6
1992 07   121.4    85.7  0.71   134.3  90.7    132.2    146.7        10     16.6
1992 08    99.5    64.5  0.65   124.4  84.0    122.1    138.9        15     16.1
1992 09    93.8    63.9  0.68   117.5  79.5    116.8    133.8        25     15.9
1992 10   136.2    88.7  0.65   113.4  76.4    131.7    130.5        15     16.7
1992 11   124.3    91.8  0.74   110.4  74.4    145.2    128.2        14     16.6
1992 12   127.4    82.6  0.65   107.7  73.2    139.1    127.4        13     16.1
1993 01    92.1    59.3  0.64   104.5  71.4    121.0    125.7        17     16.0
1993 02   126.1    91.0  0.72   101.2  69.3    142.6    123.1        16     15.9
1993 03   107.4    69.8  0.65    97.0  66.6    136.4    120.7        24     15.3
1993 04    98.6    62.2  0.63    91.9  63.6    115.9    118.1        19     14.9
1993 05    79.1    61.3  0.77    86.2  59.9    112.4    114.8        12     14.9
1993 06    68.5    49.8  0.73    81.0  56.1    109.3    111.3        12     15.0
1993 07    81.6    57.9  0.71    78.7  54.7     99.0    109.6        10     14.9
1993 08    59.4    42.2  0.71    75.7  52.3     93.7    107.6        12     15.4
1993 09    33.5    22.4  0.67    70.7  48.4     87.0    103.9        15     16.0
1993 10    73.5    56.4  0.77    65.5  44.9    100.3    100.4        14     16.4
1993 11    51.0    35.6  0.70    60.8  41.2     95.9     97.5        15     17.4
1993 12    75.9    48.9  0.64    57.9  38.4    104.8     94.8        14     18.1
1994 01    86.4    57.8  0.67    55.6  36.6    115.0     92.7        15     18.2
1994 02    60.5    35.5  0.59    53.5  34.8     99.6     91.2        30     18.1
1994 03    52.4    31.7  0.60    52.9  34.1     90.4     90.2        24     17.8
1994 04    29.3    16.1  0.55    53.0  33.7     79.1     89.3        29     18.0
1994 05    35.4    17.8  0.50    51.9  32.5     79.9     88.1        26     18.3
1994 06    42.6    28.0  0.66    49.6  30.8     77.3     86.4        14     18.2
1994 07    52.7    35.1  0.67    46.1  28.5     80.5     83.9        11     18.1
1994 08    38.4    22.5  0.59    43.8  26.8     76.1     82.0         8     17.5
1994 09    40.5    25.7  0.63    43.4  26.6     79.0     81.2        12     16.5
1994 10    67.1    44.0  0.66    43.2  26.5     87.7     80.9        22     15.5
1994 11    33.0    18.0  0.55    42.5  26.2     80.9     80.6        14     14.7
1994 12    38.7    26.2  0.68    41.4  25.6     77.4     80.4        13     14.2
1995 01    39.8    24.2  0.61    39.6  24.2     82.7     80.1        14     14.0
1995 02    51.3    29.9  0.58    37.8  23.0     85.6     79.7        15     13.9
1995 03    51.9    31.1  0.60    36.3  22.1     85.1     79.3        15     14.0
1995 04    23.6    14.0  0.59    33.8  20.6     77.7     78.6        16     13.8
1995 05    24.6    14.5  0.59    31.6  19.2     75.5     77.9        18     13.3
1995 06    27.8    15.6  0.56    29.9  18.2     75.7     77.4        11     12.9
1995 07    23.8    14.5  0.61    28.1  17.0     73.9     76.9         8     12.5
1995 08    25.1    14.3  0.57    25.4  15.4     73.8     76.0         9     12.1
1995 09    16.5    11.8  0.72    22.0  13.4     72.0     74.8        13     11.8
1995 10    31.6    21.1  0.67    19.7  12.1     77.9     73.8        16     11.4
1995 11    15.7     9.0  0.57    18.5  11.3     74.2     73.2         9     10.7
1995 12    16.2    10.0  0.62    17.6  10.8     72.6     72.8         9     10.0
1996 01    17.6    11.5  0.65    16.8  10.4     74.5     72.4         9      9.7
1996 02     9.1     4.4  0.48    16.2  10.1     71.5     72.2        10      9.7
1996 03    12.1     9.2  0.76    15.4   9.7     70.7     72.1        11      9.8
1996 04     8.5     4.8  0.56    13.6   8.4     69.3     71.6        11      9.7
1996 05    11.8     5.5  0.47    12.9   8.0     70.1     71.4         7      9.5
1996 06    18.8    11.8  0.63    13.5   8.5     69.6     71.8         5      9.4
1996 07    13.2     8.2  0.62    13.4   8.4     71.2     72.0         7      9.3
1996 08    20.5    14.4  0.70    13.1   8.3     72.4     72.1         9      9.4
1996 09     2.9     1.6  0.55    13.3   8.4     69.4     72.3        15      9.3
1996 10     2.3     0.9  0.39    14.0   8.8     69.2     72.6        13      9.1
1996 11    26.7    17.9  0.67    15.4   9.8     78.7     73.0         8      9.1
1996 12    21.1    13.3  0.63    16.2  10.4     77.8     73.3         7      9.3
1997 01     9.0     5.7  0.63    16.5  10.5     74.0     73.4         9      9.3
1997 02    11.3     7.6  0.67    17.4  11.0     73.8     73.7        11      9.2
1997 03    14.4     8.7  0.60    20.4  13.5     73.5     75.1         8      8.9
1997 04    24.5    15.5  0.63    24.0  16.5     74.5     76.8        10      8.5
1997 05    28.6    18.5  0.65    26.4  18.4     74.6     78.4         8      8.5
1997 06    22.1    12.7  0.57    29.0  20.4     71.7     80.1         7      8.5
1997 07    17.0    10.4  0.61    32.4  22.7     71.1     81.8         6      8.4
1997 08    36.7    24.4  0.66    35.9  25.1     79.0     83.4         7      8.2
1997 09    58.2    51.3  0.88    40.5  28.4     96.2     85.7        10      8.3
1997 10    33.6    23.8  0.71    45.4  31.9     84.9     88.6        10      8.5
1997 11    53.5    39.0  0.73    49.3  35.0     99.5     91.3        11      8.9
1997 12    57.9    41.2  0.71    54.2  39.0     98.8     94.2         4      9.5
1998 01    51.8    31.9  0.62    60.6  43.8     93.4     97.5         8      9.8
1998 02    54.4    40.3  0.74    67.4  49.0     93.4    101.7         8     10.5
1998 03    81.8    54.8  0.67    73.3  53.5    109.1    105.8        13     11.0
1998 04    73.6    53.4  0.73    77.7  56.6    108.3    108.9        10     11.3
1998 05    74.3    56.3  0.76    81.4  59.4    106.7    112.0        18     11.6
1998 06    93.6    70.7  0.76    85.9  62.5    108.4    115.8        10     12.0
1998 07    98.3    66.6  0.68    90.3  65.5    114.0    120.0        11     12.3
1998 08   118.6    92.2  0.78    93.7  67.8    136.0    124.1        18     12.5
1998 09   119.0    92.9  0.78    96.1  69.5    138.3    126.8        13     12.7
1998 10    77.0    55.5  0.72    97.7  70.5    117.3    127.9        13     12.8
1998 11    99.5    74.0  0.74   101.3  73.0    140.2    130.0        16     12.5
1998 12   120.8    81.9  0.68   108.8  77.9    150.1    134.3         8     12.0
1999 01    94.3    62.0  0.66   116.5  82.6    142.6    139.0        10     11.8
1999 02    93.4    66.3  0.71   120.2  84.6    142.0    142.6        12     11.6
1999 03   100.5    68.8  0.68   120.5  83.8    126.3    144.0        14     11.8
1999 04    92.9    63.7  0.69   123.8  85.5    117.2    145.8        12     12.3
1999 05   140.5   106.4  0.76   131.7  90.5    148.6    149.9         8     12.4
1999 06   208.3   137.7  0.66   136.0  93.1    169.8    152.9         7     12.4
1999 07   169.2   113.5  0.67   138.0  94.3    165.6    154.4        10     12.6
1999 08   136.1    93.7  0.69   142.8  97.5    170.8    156.3        15     12.9
1999 09   107.4    71.5  0.67   150.0 102.3    135.7    161.0        19     12.9
1999 10   167.7   116.7  0.70   158.5 107.8    164.8    167.2        19     12.8
1999 11   199.3   133.2  0.67   164.7 111.0    191.5    171.5        14     13.2
1999 12   123.5    84.6  0.69   165.9 111.1    169.8    173.4        10     13.8
2000 01   140.8    90.1  0.64   168.0 112.9    158.1    175.5        13     14.6
2000 02   161.9   112.9  0.70   172.1 116.8    173.2    176.8        16     15.1
2000 03   203.6   138.5  0.68   175.4 119.9    208.2    178.4         9     15.1
2000 04   193.4   125.5  0.65   176.3 120.8    184.2    180.5        15     15.0
2000 05   188.8   121.6  0.64   173.1 119.0    184.5    180.0        15     15.1
2000 06   190.3   124.9  0.66   172.0 118.7    179.8    179.7        15     15.1
2000 07   236.7   170.1  0.72   173.0 119.8    204.7    180.2        21     14.8
2000 08   166.6   130.5  0.78   171.8 118.6    163.1    179.4        16     14.2
2000 09   157.9   109.7  0.69   169.0 116.3    182.1    177.1        18     14.3
2000 10   138.9    99.4  0.72   166.2 114.5    167.7    175.5        18     15.0
2000 11   149.9   106.8  0.71   162.7 112.7    178.8    173.8        17     15.1
2000 12   146.4   104.4  0.71   160.8 112.0    173.6    172.0         7     14.7
2001 01   142.7    95.6  0.67   156.3 108.7    166.6    168.7         8     14.0
2001 02   131.0    80.6  0.62   151.4 104.0    146.7    165.6         7     13.3
2001 03   166.7   113.5  0.68   154.0 104.8    177.7    167.8        20     12.9
2001 04   163.6   107.7  0.66   159.4 107.5    178.1    171.6        22     12.8
2001 05   135.1    96.6  0.72   163.1 108.6    147.9    174.7        10     12.8
2001 06   196.7   134.0  0.68   167.2 109.8    173.7    178.7        10     12.8
2001 07   124.6    81.8  0.66   172.1 111.7    131.3    183.8         9     12.9
2001 08   159.4   106.4  0.67   176.7 113.6    163.1    188.8        11     13.0
2001 09   229.1   150.7  0.66   178.8 114.1    233.8    191.3        13     12.8
2001 10   197.4   125.5  0.64   179.5 114.0    208.1    191.9        20     12.1
2001 11   178.6   106.5  0.60   183.7 115.5    212.7    193.7        16     12.0
2001 12   217.5   132.2  0.61   184.5 114.6    235.6    193.9         9     12.0
2002 01   189.0   114.1  0.60   184.8 113.5    227.3    194.6         8     11.9
2002 02   194.5   107.4  0.55   188.6 114.6    205.0    197.2        10     12.1
2002 03   153.1    98.4  0.64   188.9 113.3    180.3    195.7        10     12.3
2002 04   194.9   120.7  0.62   186.2 110.5    189.8    191.5        17     12.5
2002 05   204.1   120.8  0.59   183.6 108.8    178.4    188.0        12     12.7
2002 06   146.0    88.3  0.60   179.9 106.2    148.7    182.9         7     12.9
2002 07   183.5    99.6  0.54   175.4 102.7    173.5    176.2        11     13.3
2002 08   191.0   116.4  0.61   169.2  98.7    183.9    169.3        14     13.8
2002 09   206.4   109.6  0.53   163.4  94.6    175.8    164.0        13     14.5
2002 10   153.9    97.5  0.63   158.8  90.5    167.0    159.3        25     15.1
2002 11   159.8    95.5  0.60   150.9  85.2    168.7    154.1        17     15.8
2002 12   147.9    80.8  0.55   145.0  82.0    157.2    150.7        13     17.1
2003 01   149.3    79.7  0.53   141.7  80.8    144.0    148.0        13     18.2
2003 02    87.0    46.0  0.53   136.4  78.3    124.5    143.5        17     18.9
2003 03   119.7    61.1  0.51   128.1  74.0    132.2    138.3        21     19.5
2003 04   119.7    60.0  0.50   121.5  70.1    126.3    135.0        20     20.1
2003 05    89.6    54.6  0.61   118.3  67.6    116.2    133.1        26     21.0
2003 06   118.4    77.4  0.65   113.6  65.0    129.3    130.2        24     21.5
2003 07   132.8    83.3  0.63   106.9  61.8    127.7    127.2        19     22.0
2003 08   114.3    72.7  0.64   102.8  60.0    122.1    125.2        23     22.3
2003 09    82.6    48.7  0.59   100.7  59.5    112.2    123.7        18     21.8
2003 10   118.9    65.5  0.55    96.6  58.2    151.3    121.8        35     21.1
2003 11   118.9    67.3  0.57    93.6  56.7    140.8    120.1        28     20.0
2003 12    75.4    46.5  0.62    91.4  54.8    115.0    118.0        16     18.6
2004 01    62.3    37.3  0.60    87.9  52.0    114.1    116.3        22     18.1
2004 02    75.6    45.8  0.61    84.2  49.3    107.0    115.5        13     17.7
2004 03    81.0    49.1  0.61    80.9  47.1    112.0    114.6        14     16.7
2004 04    59.3    39.3  0.66    77.9  45.5    101.2    112.4        11     15.2
2004 05    77.3    41.5  0.54    74.1  43.8     99.8    109.3         8     14.0
2004 06    78.9    43.2  0.55    70.4  41.6     97.4    107.4         8     13.6
2004 07    87.8    51.1  0.58    68.3  40.2    118.5    106.1        23     13.5
2004 08    69.5    40.9  0.59    66.6  39.2    111.0    105.2         9     13.5
2004 09    50.0    27.7  0.55    63.7  37.5    103.0    103.8         9     13.3
2004 10    77.9    48.0  0.62    61.3  35.9    105.9    102.3         8     13.3
2004 11    70.5    43.5  0.62    60.0  35.3    113.7    101.6        25     13.7
2004 12    34.7    17.9  0.52    58.8  35.2     95.0    101.5        11     14.3
2005 01    52.0    31.3  0.60    57.3  34.6    102.2    100.4        24     14.1
2005 02    45.4    29.2  0.64    56.4  33.9     97.2     98.6        11     14.0
2005 03    41.0    24.5  0.60    55.8  33.5     89.9     97.3        12     14.6
2005 04    41.5    24.2  0.58    52.6  31.6     86.0     95.5        11     15.1
2005 05    65.4    42.7  0.65    48.3  28.9     99.5     93.2        19     14.4
2005 06    59.8    39.3  0.66    47.9  28.8     93.7     91.9        12     13.6
2005 07    71.0    40.1  0.56    48.1  29.1     96.5     90.9        14     12.8
2005 08    65.6    36.4  0.55    45.4  27.4     90.5     89.2        14     11.8
2005 09    39.2    21.9  0.56    42.9  25.8     91.1     87.8        20     11.4
2005 10    13.0     8.7  0.67    42.6  25.5     76.6     87.3         8     11.3
2005 11    32.2    18.0  0.56    42.1  24.9     86.2     86.7         8     10.8
2005 12    62.6    41.1  0.66    40.1  23.0     90.7     85.2         9     10.0
2006 01    28.0    15.3  0.55    37.2  20.8     83.4     83.6         6      9.5
2006 02     5.3     4.9  0.92    33.4  18.6     76.5     82.3         6      9.0
2006 03    21.3    10.6  0.50    31.0  17.4     75.5     81.2         8      8.3
2006 04    55.2    30.2  0.55    30.6  17.1     89.0     80.6        11      7.8
2006 05    39.6    22.3  0.56    30.7  17.3     80.9     80.5         7      7.9
2006 06    37.7    13.9  0.37    28.9  16.3     76.5     80.2         7      8.2
2006 07    22.6    12.2  0.54    27.2  15.2     75.8     80.0         6      8.6
2006 08    22.8    12.9  0.57    27.6  15.6     79.4     80.1         9      8.8
2006 09    25.2    14.4  0.57    27.7  15.5     77.8     80.0         8      8.8
2006 10    15.7    10.5  0.67    25.2  14.2     74.3     79.1         9      8.8
2006 11    31.5    21.4  0.68    22.3  12.6     86.3     78.2         9      8.7
2006 12    22.2    13.6  0.61    20.7  12.1     84.5     77.8        15      8.7
2007 01    26.6    16.8  0.63    19.7  11.9     83.5     77.5        10      8.7
2007 02    17.2    10.7  0.62    18.9  11.5     77.7     76.9         7      8.6
2007 03     9.7     4.5  0.46    17.5  10.7     72.2     76.0         8      8.5
2007 04     6.9     3.4  0.49    16.0   9.8     72.4     75.3         9      8.5
2007 05    19.4    11.7  0.60    14.2   8.6     74.4     74.3         8      8.3
2007 06    20.0    12.1  0.61    12.8   7.6     73.7     73.3         6      7.9
2007 07    15.6     9.7  0.62    11.6   6.9     71.6     72.7         7      7.4
2007 08     9.9     6.0  0.61    10.2   6.0     69.1     72.1         6      7.5
2007 09     4.8     2.4  0.50     9.9   5.9     67.0     71.8         9      7.8
2007 10     1.3     0.9  0.69    10.0   6.0     67.5     71.8         7      7.9
2007 11     2.5     1.7  0.68     9.4   5.7     69.6     71.4         7      7.8
2007 12    16.2    10.1  0.62     8.1   4.9     78.5     70.8         6      7.8
2008 01     5.1     3.3  0.65     6.9   4.2     74.3     70.3         8      7.8
2008 02     3.8     2.1  0.55     5.9   3.6     71.1     69.9        11      7.6
2008 03    15.9     9.3  0.58     5.3   3.3     72.9     69.8        11      7.5
2008 04     4.9     2.9  0.59     5.3   3.4     70.2     69.8         9      7.3
2008 05     5.7     3.2  0.56     5.7   3.5     68.4     69.8         6      7.2
2008 06     4.2     3.4  0.81     5.2   3.3     65.9     69.4         7      7.0
2008 07     1.0     0.8  0.80     4.5   2.8     65.7     68.8         5      6.8
2008 08     0.0     0.5 -1.00     4.4   2.7     66.3     68.6         5      6.3
2008 09     1.5     1.1  0.73     3.7   2.3     67.1     68.4         6      5.8
2008 10     5.2     2.9  0.56     2.9   1.8     68.3     68.2         7      5.4
2008 11     6.8     4.1  0.60     2.7   1.7     68.6     68.3         4      5.1
2008 12     1.3     0.8  0.62     2.7   1.7     69.2     68.5         4      4.9
2009 01     2.8     1.3  0.46     3.0   1.8     69.8     68.7         4      4.7
2009 02     2.5     1.4  0.56     3.1   1.9     70.0     68.8         5      4.7
2009 03     0.7     0.7  1.00     3.4   2.0     69.2     69.0         5      4.6
2009 04     1.2     0.8  1.00     3.7   2.2     69.7     69.3         4      4.3
2009 05     3.9     2.9  0.74     3.8   2.3     70.5     69.7         4      4.1
2009 06     6.6     2.9  0.39     4.4   2.7     68.6     70.2         4      4.0
2009 07     5.0     3.2  0.70     5.8   3.6     68.2     71.0         4      3.9
2009 08     0.3     0.0  0.00     7.7   4.8     67.4     72.1         5      3.8
2009 09     6.6     4.3  0.64     9.9   6.2     70.5     73.3         4      3.8
2009 10     7.0     4.8  0.66    11.3   7.1     72.3     74.1         3      4.1
2009 11     7.7     4.1  0.55    12.4   7.6     73.6     74.5         3      4.5
2009 12    15.7    10.8  0.68    13.6   8.3     76.8     74.9         2      4.8
2010 01    21.3    13.2  0.62    14.8   9.3     81.1     75.5         3      5.0
2010 02    31.0    18.8  0.60    16.7  10.6     84.7     76.5         5      5.1
2010 03    24.7    15.4  0.62    19.1  12.3     83.3     77.5         5      5.3
2010 04    11.2     8.0  0.71    21.4  14.0     75.9     78.3        10      5.5
2010 05    19.9     8.7  0.44    23.8  15.5     73.8     79.0         8      5.7
2010 06    17.9    13.6  0.75    25.2  16.4     72.6     79.7         7      5.8
2010 07    23.1    16.1  0.70    25.9  16.7     79.9     80.1         5      6.0
2010 08    28.2    19.6  0.70    27.3  17.4     79.7     80.7         8      6.2
2010 09    35.6    25.2  0.71    30.6  19.6     81.1     82.4         5      6.3
2010 10    35.0    23.5  0.67    35.9  23.2     81.6     85.3         6      6.4
2010 11    36.1    21.5  0.60    40.5  26.5     82.5     87.7         5      6.4
2010 12    22.0    14.4  0.66    43.8  28.8     84.3     89.6         4      6.5
2011 01    32.1    18.8  0.59    47.2  30.9     83.7     91.2         6      6.7
2011 02    53.2    29.6  0.55    50.6  33.4     94.5     92.7         6      6.8
2011 03    81.0    55.8  0.69    55.2  36.9    115.3     95.8         7      7.2
2011 04    81.7    54.4  0.67    61.5  41.8    112.6    100.4         9      7.5
2011 05    61.4    41.5  0.68    69.0  47.6     95.9    105.6         9      7.5
2011 06    55.5    37.0  0.67    76.5  53.2     95.8    110.9         8      7.4
2011 07    67.0    43.8  0.66    82.5  57.2     94.2    115.4         9      7.3
2011 08    66.1    50.6  0.77    84.9  59.0    101.7    117.9         8      7.4
2011 09   106.4    78.0  0.73    84.6  59.5    134.5    118.4        13      7.7
2011 10   116.8    88.0  0.75    84.6  59.9    137.2    118.4         7      8.0
2011 11   133.1    96.7  0.73    86.3  61.1    153.1    119.5         3      8.0
2011 12   106.3    73.0  0.69    89.2  63.4    141.2    121.6         3      8.0
2012 01    91.3    58.3  0.64    92.0  65.5    133.1    124.4         6      8.3
2012 02    50.1    32.9  0.66    -1.0  -1.0    106.7     -1.0         7     -1.0
2012 03    77.9    64.3  0.82    -1.0  -1.0    115.1     -1.0        14     -1.0
2012 04    84.4    55.2  0.65    -1.0  -1.0    113.1     -1.0         9     -1.0
2012 05    99.5    69.0  0.69    -1.0  -1.0    121.5     -1.0         8     -1.0
2012 06    88.6    64.5  0.73    -1.0  -1.0    120.5     -1.0        10     -1.0
/*
* 提示:该行代码过长,系统自动注释不进行高亮。一键复制会移除系统注释 
* 2012 07    99.6    66.5  0.67    -1.0  -1.0    135.6     -1.0        13     -1Recent_Solar_Indices: RecentIndices.txt:Created: 2012 Aug 06 0759 UTC# Prepared by the U.S. Dept. of Commerce, NOAA, Space Weather Prediction Center (SWPC).# Please send comments and suggestions to swpc.webmaster@noaa.gov## Source SWO: SWPC Space Weather Operations (SWO).# Source RI: S.I.D.C. Brussels International Sunspot Number.# Source 10.7cm radio flux values (sfu): Penticton, B.C., Canada.# # Source Ap: GeoForschungsZentrum, Postdam, Germany#            Prior to January 1997, Institut fur Geophysik, Gottingen, Germany# Source Ap for final month is NOAA/SWPC estimated Ap.## Data not yet available or not calculable: -1.0## Values for most recent 6 months are considered preliminary. # Final values from National Geophysical Data Center www.ngdc.noaa.gov##                               Recent Solar Indices#                         of Observed Monthly Mean Values##       -----------Sunspot Numbers--------- ----Radio Flux---  ---Geomagnetic---#       ---Observed---- Ratio   --Smoothed- Observed Smoothed  Observed Smoothed# YR MO    SWO     RI   RI/SW    SWO   RI     10.7cm  10.7cm      Ap       Ap#-------------------------------------------------------------------------------1991 01   213.5   136.9  0.64   220.5 147.6    229.4    205.5         8     17.41991 02   270.2   167.5  0.62   221.5 147.6    243.0    206.3        10     18.41991 03   227.9   141.9  0.62   220.7 146.6    230.0    205.9        27     19.11991 04   215.9   140.0  0.65   220.7 146.5    198.8    206.8        17     20.01991 05   182.5   121.3  0.66   219.6 145.5    190.3    207.1        18     21.71991 06   231.8   169.7  0.73   218.9 145.2    206.8    207.4        44     23.01991 07   245.7   173.7  0.71   219.5 146.3    212.0    207.7        27     23.61991 08   251.5   176.3  0.70   218.3 146.6    210.3    206.8        30     24.71991 09   185.8   125.3  0.67   214.2 144.9    180.6    203.9        20     25.01991 10   220.1   144.1  0.65   208.4 141.7    201.3    199.7        31     24.31991 11   169.0   108.2  0.64   202.2 138.1    172.0    195.4        33     24.11991 12   217.7   144.4  0.66   193.7 131.7    223.9    188.9        15     23.01992 01   217.9   150.0  0.69   183.3 123.7    217.6    181.8        14     21.11992 02   238.2   161.1  0.68   171.8 115.4    232.1    174.8        31     19.81992 03   160.5   106.7  0.66   161.6 108.2    171.3    168.5        14     19.41992 04   144.0    99.8  0.69   154.3 103.3    158.5    162.9        11     18.91992 05   106.3    73.8  0.69   148.9 100.3    125.4    158.9        21     17.51992 06   104.7    65.2  0.62   143.3  97.1    116.7    154.3        15     16.61992 07   121.4    85.7  0.71   134.3  90.7    132.2    146.7        10     16.61992 08    99.5    64.5  0.65   124.4  84.0    122.1    138.9        15     16.11992 09    93.8    63.9  0.68   117.5  79.5    116.8    133.8        25     15.91992 10   136.2    88.7  0.65   113.4  76.4    131.7    130.5        15     16.71992 11   124.3    91.8  0.74   110.4  74.4    145.2    128.2        14     16.61992 12   127.4    82.6  0.65   107.7  73.2    139.1    127.4        13     16.11993 01    92.1    59.3  0.64   104.5  71.4    121.0    125.7        17     16.01993 02   126.1    91.0  0.72   101.2  69.3    142.6    123.1        16     15.91993 03   107.4    69.8  0.65    97.0  66.6    136.4    120.7        24     15.31993 04    98.6    62.2  0.63    91.9  63.6    115.9    118.1        19     14.91993 05    79.1    61.3  0.77    86.2  59.9    112.4    114.8        12     14.91993 06    68.5    49.8  0.73    81.0  56.1    109.3    111.3        12     15.01993 07    81.6    57.9  0.71    78.7  54.7     99.0    109.6        10     14.91993 08    59.4    42.2  0.71    75.7  52.3     93.7    107.6        12     15.41993 09    33.5    22.4  0.67    70.7  48.4     87.0    103.9        15     16.01993 10    73.5    56.4  0.77    65.5  44.9    100.3    100.4        14     16.41993 11    51.0    35.6  0.70    60.8  41.2     95.9     97.5        15     17.41993 12    75.9    48.9  0.64    57.9  38.4    104.8     94.8        14     18.11994 01    86.4    57.8  0.67    55.6  36.6    115.0     92.7        15     18.21994 02    60.5    35.5  0.59    53.5  34.8     99.6     91.2        30     18.11994 03    52.4    31.7  0.60    52.9  34.1     90.4     90.2        24     17.81994 04    29.3    16.1  0.55    53.0  33.7     79.1     89.3        29     18.01994 05    35.4    17.8  0.50    51.9  32.5     79.9     88.1        26     18.31994 06    42.6    28.0  0.66    49.6  30.8     77.3     86.4        14     18.21994 07    52.7    35.1  0.67    46.1  28.5     80.5     83.9        11     18.11994 08    38.4    22.5  0.59    43.8  26.8     76.1     82.0         8     17.51994 09    40.5    25.7  0.63    43.4  26.6     79.0     81.2        12     16.51994 10    67.1    44.0  0.66    43.2  26.5     87.7     80.9        22     15.51994 11    33.0    18.0  0.55    42.5  26.2     80.9     80.6        14     14.71994 12    38.7    26.2  0.68    41.4  25.6     77.4     80.4        13     14.21995 01    39.8    24.2  0.61    39.6  24.2     82.7     80.1        14     14.01995 02    51.3    29.9  0.58    37.8  23.0     85.6     79.7        15     13.91995 03    51.9    31.1  0.60    36.3  22.1     85.1     79.3        15     14.01995 04    23.6    14.0  0.59    33.8  20.6     77.7     78.6        16     13.81995 05    24.6    14.5  0.59    31.6  19.2     75.5     77.9        18     13.31995 06    27.8    15.6  0.56    29.9  18.2     75.7     77.4        11     12.91995 07    23.8    14.5  0.61    28.1  17.0     73.9     76.9         8     12.51995 08    25.1    14.3  0.57    25.4  15.4     73.8     76.0         9     12.11995 09    16.5    11.8  0.72    22.0  13.4     72.0     74.8        13     11.81995 10    31.6    21.1  0.67    19.7  12.1     77.9     73.8        16     11.41995 11    15.7     9.0  0.57    18.5  11.3     74.2     73.2         9     10.71995 12    16.2    10.0  0.62    17.6  10.8     72.6     72.8         9     10.01996 01    17.6    11.5  0.65    16.8  10.4     74.5     72.4         9      9.71996 02     9.1     4.4  0.48    16.2  10.1     71.5     72.2        10      9.71996 03    12.1     9.2  0.76    15.4   9.7     70.7     72.1        11      9.81996 04     8.5     4.8  0.56    13.6   8.4     69.3     71.6        11      9.71996 05    11.8     5.5  0.47    12.9   8.0     70.1     71.4         7      9.51996 06    18.8    11.8  0.63    13.5   8.5     69.6     71.8         5      9.41996 07    13.2     8.2  0.62    13.4   8.4     71.2     72.0         7      9.31996 08    20.5    14.4  0.70    13.1   8.3     72.4     72.1         9      9.41996 09     2.9     1.6  0.55    13.3   8.4     69.4     72.3        15      9.31996 10     2.3     0.9  0.39    14.0   8.8     69.2     72.6        13      9.11996 11    26.7    17.9  0.67    15.4   9.8     78.7     73.0         8      9.11996 12    21.1    13.3  0.63    16.2  10.4     77.8     73.3         7      9.31997 01     9.0     5.7  0.63    16.5  10.5     74.0     73.4         9      9.31997 02    11.3     7.6  0.67    17.4  11.0     73.8     73.7        11      9.21997 03    14.4     8.7  0.60    20.4  13.5     73.5     75.1         8      8.91997 04    24.5    15.5  0.63    24.0  16.5     74.5     76.8        10      8.51997 05    28.6    18.5  0.65    26.4  18.4     74.6     78.4         8      8.51997 06    22.1    12.7  0.57    29.0  20.4     71.7     80.1         7      8.51997 07    17.0    10.4  0.61    32.4  22.7     71.1     81.8         6      8.41997 08    36.7    24.4  0.66    35.9  25.1     79.0     83.4         7      8.21997 09    58.2    51.3  0.88    40.5  28.4     96.2     85.7        10      8.31997 10    33.6    23.8  0.71    45.4  31.9     84.9     88.6        10      8.51997 11    53.5    39.0  0.73    49.3  35.0     99.5     91.3        11      8.91997 12    57.9    41.2  0.71    54.2  39.0     98.8     94.2         4      9.51998 01    51.8    31.9  0.62    60.6  43.8     93.4     97.5         8      9.81998 02    54.4    40.3  0.74    67.4  49.0     93.4    101.7         8     10.51998 03    81.8    54.8  0.67    73.3  53.5    109.1    105.8        13     11.01998 04    73.6    53.4  0.73    77.7  56.6    108.3    108.9        10     11.31998 05    74.3    56.3  0.76    81.4  59.4    106.7    112.0        18     11.61998 06    93.6    70.7  0.76    85.9  62.5    108.4    115.8        10     12.01998 07    98.3    66.6  0.68    90.3  65.5    114.0    120.0        11     12.31998 08   118.6    92.2  0.78    93.7  67.8    136.0    124.1        18     12.51998 09   119.0    92.9  0.78    96.1  69.5    138.3    126.8        13     12.71998 10    77.0    55.5  0.72    97.7  70.5    117.3    127.9        13     12.81998 11    99.5    74.0  0.74   101.3  73.0    140.2    130.0        16     12.51998 12   120.8    81.9  0.68   108.8  77.9    150.1    134.3         8     12.01999 01    94.3    62.0  0.66   116.5  82.6    142.6    139.0        10     11.81999 02    93.4    66.3  0.71   120.2  84.6    142.0    142.6        12     11.61999 03   100.5    68.8  0.68   120.5  83.8    126.3    144.0        14     11.81999 04    92.9    63.7  0.69   123.8  85.5    117.2    145.8        12     12.31999 05   140.5   106.4  0.76   131.7  90.5    148.6    149.9         8     12.41999 06   208.3   137.7  0.66   136.0  93.1    169.8    152.9         7     12.41999 07   169.2   113.5  0.67   138.0  94.3    165.6    154.4        10     12.61999 08   136.1    93.7  0.69   142.8  97.5    170.8    156.3        15     12.91999 09   107.4    71.5  0.67   150.0 102.3    135.7    161.0        19     12.91999 10   167.7   116.7  0.70   158.5 107.8    164.8    167.2        19     12.81999 11   199.3   133.2  0.67   164.7 111.0    191.5    171.5        14     13.21999 12   123.5    84.6  0.69   165.9 111.1    169.8    173.4        10     13.82000 01   140.8    90.1  0.64   168.0 112.9    158.1    175.5        13     14.62000 02   161.9   112.9  0.70   172.1 116.8    173.2    176.8        16     15.12000 03   203.6   138.5  0.68   175.4 119.9    208.2    178.4         9     15.12000 04   193.4   125.5  0.65   176.3 120.8    184.2    180.5        15     15.02000 05   188.8   121.6  0.64   173.1 119.0    184.5    180.0        15     15.12000 06   190.3   124.9  0.66   172.0 118.7    179.8    179.7        15     15.12000 07   236.7   170.1  0.72   173.0 119.8    204.7    180.2        21     14.82000 08   166.6   130.5  0.78   171.8 118.6    163.1    179.4        16     14.22000 09   157.9   109.7  0.69   169.0 116.3    182.1    177.1        18     14.32000 10   138.9    99.4  0.72   166.2 114.5    167.7    175.5        18     15.02000 11   149.9   106.8  0.71   162.7 112.7    178.8    173.8        17     15.12000 12   146.4   104.4  0.71   160.8 112.0    173.6    172.0         7     14.72001 01   142.7    95.6  0.67   156.3 108.7    166.6    168.7         8     14.02001 02   131.0    80.6  0.62   151.4 104.0    146.7    165.6         7     13.32001 03   166.7   113.5  0.68   154.0 104.8    177.7    167.8        20     12.92001 04   163.6   107.7  0.66   159.4 107.5    178.1    171.6        22     12.82001 05   135.1    96.6  0.72   163.1 108.6    147.9    174.7        10     12.82001 06   196.7   134.0  0.68   167.2 109.8    173.7    178.7        10     12.82001 07   124.6    81.8  0.66   172.1 111.7    131.3    183.8         9     12.92001 08   159.4   106.4  0.67   176.7 113.6    163.1    188.8        11     13.02001 09   229.1   150.7  0.66   178.8 114.1    233.8    191.3        13     12.82001 10   197.4   125.5  0.64   179.5 114.0    208.1    191.9        20     12.12001 11   178.6   106.5  0.60   183.7 115.5    212.7    193.7        16     12.02001 12   217.5   132.2  0.61   184.5 114.6    235.6    193.9         9     12.02002 01   189.0   114.1  0.60   184.8 113.5    227.3    194.6         8     11.92002 02   194.5   107.4  0.55   188.6 114.6    205.0    197.2        10     12.12002 03   153.1    98.4  0.64   188.9 113.3    180.3    195.7        10     12.32002 04   194.9   120.7  0.62   186.2 110.5    189.8    191.5        17     12.52002 05   204.1   120.8  0.59   183.6 108.8    178.4    188.0        12     12.72002 06   146.0    88.3  0.60   179.9 106.2    148.7    182.9         7     12.92002 07   183.5    99.6  0.54   175.4 102.7    173.5    176.2        11     13.32002 08   191.0   116.4  0.61   169.2  98.7    183.9    169.3        14     13.82002 09   206.4   109.6  0.53   163.4  94.6    175.8    164.0        13     14.52002 10   153.9    97.5  0.63   158.8  90.5    167.0    159.3        25     15.12002 11   159.8    95.5  0.60   150.9  85.2    168.7    154.1        17     15.82002 12   147.9    80.8  0.55   145.0  82.0    157.2    150.7        13     17.12003 01   149.3    79.7  0.53   141.7  80.8    144.0    148.0        13     18.22003 02    87.0    46.0  0.53   136.4  78.3    124.5    143.5        17     18.92003 03   119.7    61.1  0.51   128.1  74.0    132.2    138.3        21     19.52003 04   119.7    60.0  0.50   121.5  70.1    126.3    135.0        20     20.12003 05    89.6    54.6  0.61   118.3  67.6    116.2    133.1        26     21.02003 06   118.4    77.4  0.65   113.6  65.0    129.3    130.2        24     21.52003 07   132.8    83.3  0.63   106.9  61.8    127.7    127.2        19     22.02003 08   114.3    72.7  0.64   102.8  60.0    122.1    125.2        23     22.32003 09    82.6    48.7  0.59   100.7  59.5    112.2    123.7        18     21.82003 10   118.9    65.5  0.55    96.6  58.2    151.3    121.8        35     21.12003 11   118.9    67.3  0.57    93.6  56.7    140.8    120.1        28     20.02003 12    75.4    46.5  0.62    91.4  54.8    115.0    118.0        16     18.62004 01    62.3    37.3  0.60    87.9  52.0    114.1    116.3        22     18.12004 02    75.6    45.8  0.61    84.2  49.3    107.0    115.5        13     17.72004 03    81.0    49.1  0.61    80.9  47.1    112.0    114.6        14     16.72004 04    59.3    39.3  0.66    77.9  45.5    101.2    112.4        11     15.22004 05    77.3    41.5  0.54    74.1  43.8     99.8    109.3         8     14.02004 06    78.9    43.2  0.55    70.4  41.6     97.4    107.4         8     13.62004 07    87.8    51.1  0.58    68.3  40.2    118.5    106.1        23     13.52004 08    69.5    40.9  0.59    66.6  39.2    111.0    105.2         9     13.52004 09    50.0    27.7  0.55    63.7  37.5    103.0    103.8         9     13.32004 10    77.9    48.0  0.62    61.3  35.9    105.9    102.3         8     13.32004 11    70.5    43.5  0.62    60.0  35.3    113.7    101.6        25     13.72004 12    34.7    17.9  0.52    58.8  35.2     95.0    101.5        11     14.32005 01    52.0    31.3  0.60    57.3  34.6    102.2    100.4        24     14.12005 02    45.4    29.2  0.64    56.4  33.9     97.2     98.6        11     14.02005 03    41.0    24.5  0.60    55.8  33.5     89.9     97.3        12     14.62005 04    41.5    24.2  0.58    52.6  31.6     86.0     95.5        11     15.12005 05    65.4    42.7  0.65    48.3  28.9     99.5     93.2        19     14.42005 06    59.8    39.3  0.66    47.9  28.8     93.7     91.9        12     13.62005 07    71.0    40.1  0.56    48.1  29.1     96.5     90.9        14     12.82005 08    65.6    36.4  0.55    45.4  27.4     90.5     89.2        14     11.82005 09    39.2    21.9  0.56    42.9  25.8     91.1     87.8        20     11.42005 10    13.0     8.7  0.67    42.6  25.5     76.6     87.3         8     11.32005 11    32.2    18.0  0.56    42.1  24.9     86.2     86.7         8     10.82005 12    62.6    41.1  0.66    40.1  23.0     90.7     85.2         9     10.02006 01    28.0    15.3  0.55    37.2  20.8     83.4     83.6         6      9.52006 02     5.3     4.9  0.92    33.4  18.6     76.5     82.3         6      9.02006 03    21.3    10.6  0.50    31.0  17.4     75.5     81.2         8      8.32006 04    55.2    30.2  0.55    30.6  17.1     89.0     80.6        11      7.82006 05    39.6    22.3  0.56    30.7  17.3     80.9     80.5         7      7.92006 06    37.7    13.9  0.37    28.9  16.3     76.5     80.2         7      8.22006 07    22.6    12.2  0.54    27.2  15.2     75.8     80.0         6      8.62006 08    22.8    12.9  0.57    27.6  15.6     79.4     80.1         9      8.82006 09    25.2    14.4  0.57    27.7  15.5     77.8     80.0         8      8.82006 10    15.7    10.5  0.67    25.2  14.2     74.3     79.1         9      8.82006 11    31.5    21.4  0.68    22.3  12.6     86.3     78.2         9      8.72006 12    22.2    13.6  0.61    20.7  12.1     84.5     77.8        15      8.72007 01    26.6    16.8  0.63    19.7  11.9     83.5     77.5        10      8.72007 02    17.2    10.7  0.62    18.9  11.5     77.7     76.9         7      8.62007 03     9.7     4.5  0.46    17.5  10.7     72.2     76.0         8      8.52007 04     6.9     3.4  0.49    16.0   9.8     72.4     75.3         9      8.52007 05    19.4    11.7  0.60    14.2   8.6     74.4     74.3         8      8.32007 06    20.0    12.1  0.61    12.8   7.6     73.7     73.3         6      7.92007 07    15.6     9.7  0.62    11.6   6.9     71.6     72.7         7      7.42007 08     9.9     6.0  0.61    10.2   6.0     69.1     72.1         6      7.52007 09     4.8     2.4  0.50     9.9   5.9     67.0     71.8         9      7.82007 10     1.3     0.9  0.69    10.0   6.0     67.5     71.8         7      7.92007 11     2.5     1.7  0.68     9.4   5.7     69.6     71.4         7      7.82007 12    16.2    10.1  0.62     8.1   4.9     78.5     70.8         6      7.82008 01     5.1     3.3  0.65     6.9   4.2     74.3     70.3         8      7.82008 02     3.8     2.1  0.55     5.9   3.6     71.1     69.9        11      7.62008 03    15.9     9.3  0.58     5.3   3.3     72.9     69.8        11      7.52008 04     4.9     2.9  0.59     5.3   3.4     70.2     69.8         9      7.32008 05     5.7     3.2  0.56     5.7   3.5     68.4     69.8         6      7.22008 06     4.2     3.4  0.81     5.2   3.3     65.9     69.4         7      7.02008 07     1.0     0.8  0.80     4.5   2.8     65.7     68.8         5      6.82008 08     0.0     0.5 -1.00     4.4   2.7     66.3     68.6         5      6.32008 09     1.5     1.1  0.73     3.7   2.3     67.1     68.4         6      5.82008 10     5.2     2.9  0.56     2.9   1.8     68.3     68.2         7      5.42008 11     6.8     4.1  0.60     2.7   1.7     68.6     68.3         4      5.12008 12     1.3     0.8  0.62     2.7   1.7     69.2     68.5         4      4.92009 01     2.8     1.3  0.46     3.0   1.8     69.8     68.7         4      4.72009 02     2.5     1.4  0.56     3.1   1.9     70.0     68.8         5      4.72009 03     0.7     0.7  1.00     3.4   2.0     69.2     69.0         5      4.62009 04     1.2     0.8  1.00     3.7   2.2     69.7     69.3         4      4.32009 05     3.9     2.9  0.74     3.8   2.3     70.5     69.7         4      4.12009 06     6.6     2.9  0.39     4.4   2.7     68.6     70.2         4      4.02009 07     5.0     3.2  0.70     5.8   3.6     68.2     71.0         4      3.92009 08     0.3     0.0  0.00     7.7   4.8     67.4     72.1         5      3.82009 09     6.6     4.3  0.64     9.9   6.2     70.5     73.3         4      3.82009 10     7.0     4.8  0.66    11.3   7.1     72.3     74.1         3      4.12009 11     7.7     4.1  0.55    12.4   7.6     73.6     74.5         3      4.52009 12    15.7    10.8  0.68    13.6   8.3     76.8     74.9         2      4.82010 01    21.3    13.2  0.62    14.8   9.3     81.1     75.5         3      5.02010 02    31.0    18.8  0.60    16.7  10.6     84.7     76.5         5      5.12010 03    24.7    15.4  0.62    19.1  12.3     83.3     77.5         5      5.32010 04    11.2     8.0  0.71    21.4  14.0     75.9     78.3        10      5.52010 05    19.9     8.7  0.44    23.8  15.5     73.8     79.0         8      5.72010 06    17.9    13.6  0.75    25.2  16.4     72.6     79.7         7      5.82010 07    23.1    16.1  0.70    25.9  16.7     79.9     80.1         5      6.02010 08    28.2    19.6  0.70    27.3  17.4     79.7     80.7         8      6.22010 09    35.6    25.2  0.71    30.6  19.6     81.1     82.4         5      6.32010 10    35.0    23.5  0.67    35.9  23.2     81.6     85.3         6      6.42010 11    36.1    21.5  0.60    40.5  26.5     82.5     87.7         5      6.42010 12    22.0    14.4  0.66    43.8  28.8     84.3     89.6         4      6.52011 01    32.1    18.8  0.59    47.2  30.9     83.7     91.2         6      6.72011 02    53.2    29.6  0.55    50.6  33.4     94.5     92.7         6      6.82011 03    81.0    55.8  0.69    55.2  36.9    115.3     95.8         7      7.22011 04    81.7    54.4  0.67    61.5  41.8    112.6    100.4         9      7.52011 05    61.4    41.5  0.68    69.0  47.6     95.9    105.6         9      7.52011 06    55.5    37.0  0.67    76.5  53.2     95.8    110.9         8      7.42011 07    67.0    43.8  0.66    82.5  57.2     94.2    115.4         9      7.32011 08    66.1    50.6  0.77    84.9  59.0    101.7    117.9         8      7.42011 09   106.4    78.0  0.73    84.6  59.5    134.5    118.4        13      7.72011 10   116.8    88.0  0.75    84.6  59.9    137.2    118.4         7      8.02011 11   133.1    96.7  0.73    86.3  61.1    153.1    119.5         3      8.02011 12   106.3    73.0  0.69    89.2  63.4    141.2    121.6         3      8.02012 01    91.3    58.3  0.64    92.0  65.5    133.1    124.4         6      8.32012 02    50.1    32.9  0.66    -1.0  -1.0    106.7     -1.0         7     -1.02012 03    77.9    64.3  0.82    -1.0  -1.0    115.1     -1.0        14     -1.02012 04    84.4    55.2  0.65    -1.0  -1.0    113.1     -1.0         9     -1.02012 05    99.5    69.0  0.69    -1.0  -1.0    121.5     -1.0         8     -1.02012 06    88.6    64.5  0.73    -1.0  -1.0    120.5     -1.0        10     -1.02012 07    99.6    66.5  0.67    -1.0  -1.0    135.6     -1.0        13     -1.0​
*/

07、演示

08、QPieSeries

QPieSeries 是 Qt 中 QChart 类的一个成员,用于创建饼图系列。饼图是一种常见的图表类型,用于展示各部分占整体的比例关系。QPieSeries 可以包含多个数据点,每个数据点对应饼图中的一个扇区。

09、QPieSlice

QPieSlice 是 QPieSeries 类的一个内部类,它代表饼图中的一个扇区。每个 QPieSlice 都有一个对应的值和角度,这些属性决定了它在饼图中所占的比例和位置。你可以通过设置 QPieSlice 的值来改变扇区的大小,从而反映不同数据点在总体中的比例。此外,你还可以设置扇区的颜色、标签等属性,以增强图表的可读性和美观性。

10、main.cpp

代码语言:javascript复制
#include <QtWidgets/QApplication>
#include <QtWidgets/QMainWindow>
#include <QtCharts/QChartView>
#include <QtCharts/QPieSeries>
#include <QtCharts/QPieSlice>
#include <QtCore/QDebug>
//QT_CHARTS_USE_NAMESPACE
​
int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
​
//![1]
    QPieSeries *series = new QPieSeries();
    series->setHoleSize(0.35);
    series->append("Protein 4.2%", 4.2);
    QPieSlice *slice = series->append("Fat 15.6%", 15.6);
    slice->setExploded();
    slice->setLabelVisible();
    series->append("Other 23.8%", 23.8);
    series->append("Carbs 56.4%", 56.4);
//![1]
​
//![2]
    QChartView *chartView = new QChartView();
    chartView->setRenderHint(QPainter::Antialiasing);
    chartView->chart()->setTitle("Donut with a lemon glaze (100g)");
    chartView->chart()->addSeries(series);
    chartView->chart()->legend()->setAlignment(Qt::AlignBottom);
    chartView->chart()->setTheme(QChart::ChartThemeBlueCerulean);
    chartView->chart()->legend()->setFont(QFont("Arial", 7));
//![2]
​
//![3]
    QMainWindow window;
    window.setCentralWidget(chartView);
    window.resize(400, 300);
    window.show();
//![3]
​
    return a.exec();
}
​

演示

0 人点赞