Qt C++ chartdir学习 demo

Python模块之chardir: 使用chartdir生成各种图表 使用chartdir来生成图表真的是太方便了!!可以用与web中生成图片,也可以作为单独的应用程序生成各类统计图,非常实用,也非常的好用,还跨平台。美中不足的是图片中使用中文的时候有些问题,因为使用了PIL来生成图片,偏偏PIL对中文的支持不够。。。它的官方网站是 http://www.advsofteng.com/download.html它同时也提供 ChartDirector for ASP 阅读详情

void ContourWidget::drawContour()
{
    XYChart *poXYChart = new XYChart(this->width(), this->height(), 0xffffff, 0x888888);

    poXYChart->addTitle(title.toUtf8(), "Arial Bold Italic", 16);

    poXYChart->setPlotArea((this->width()-this->height())/2, 40, this->height(), this->height()-100);

    poXYChart->xAxis()->setTitle("经度(°)", "Arial Bold Italic", 12);
    poXYChart->yAxis()->setTitle("纬度(°)", "Arial Bold Italic", 12);

     poXYChart->xAxis()->setLinearScale(minX, maxX);
     poXYChart->yAxis()->setLinearScale(minY, maxY);

     poXYChart->xAxis()->setLabelStyle("Arial Bold");
     poXYChart->yAxis()->setLabelStyle("Arial Bold");

     poXYChart->yAxis()->setTickDensity(40);
     poXYChart->xAxis()->setTickDensity(40);

     ContourLayer* layer = poXYChart->addContourLayer(DoubleArray(adX, size),
                                                      DoubleArray(adY, size),
                                                      DoubleArray(adZ, size));

     poXYChart->getPlotArea()->moveGridBefore(layer);

     ColorAxis* cAxis = layer->setColorAxis(this->width() - 300, this->height()*0.1545, Chart::TopLeft, this->height()*0.618, Chart::Right);

     cAxis->setLinearScale(minZ, maxZ, (maxZ-minZ)/20);
     cAxis->setTitle("总场(mV)", "Arial Bold Italic", 12);

    cAxis->setLabelStyle("Arial Bold");

    int colorGradient[] = {0x9999FF,  0x0000CC,  0x00CC00,  0xFFFF00,  0xEE0000,  0xFF0000};
    const int colorGradient_size = (int)(sizeof(colorGradient)/sizeof(*colorGradient));
    cAxis->setColorGradient(false, IntArray(colorGradient, colorGradient_size));

    ui->chartViewer->setChart(poXYChart);

    ui->chartViewer->setImageMap(poXYChart->getHTMLImageMap("", "", "title='<*cdml*><*font=bold*>经度(°): {x|8}<*br*>纬度(°): {y|8}<*br*>总场(mV): {z|6}''"));
}

下面这段就是抄了官网的example。纯属hello world 阶段学习。

#include <math.h>
#include <QLabel>
#include <QCheckBox>
#include <QMouseEvent>
#include "threedchartrotation.h"
#include "chartdir.h"
#include <QVBoxLayout>

#include <iostream>
#include <cmath>

#include <QButtonGroup>

ThreeDChartRotation::ThreeDChartRotation(QString title,
                                         double *adX, double *adY, double *adZ, double *adW,
                                         double minX, double maxX,
                                         double minY, double maxY,
                                         double minZ, double maxZ,
                                         double minW, double maxW,
                                         int size, QWidget *parent) :
    QDialog(parent)
{
    // Set up the GUI
    this->setWindowTitle("三维曲面等高线图");
    this->setWindowIcon(QIcon(":/new/prefix1/image/3D.png"));
    this->setMinimumSize(800, 800);
    this->setWindowFlags(Qt::WindowMinimizeButtonHint | Qt::WindowMaximizeButtonHint | Qt::WindowCloseButtonHint);

    m_DrawFrameOnRotate = new QCheckBox("旋转时绘制网格框架");
    m_DrawFrameOnRotate->setStyleSheet("font-size:12px Arial;");
    m_DrawFrameOnRotate->setChecked(true);

    QButtonGroup *poButtonGroup = new QButtonGroup;
    poButtonGroup->setExclusive(true);

    QCheckBox *poCheckBoxTotal = new QCheckBox("Z轴展示总场");
    poCheckBoxTotal->setChecked(true);
    QCheckBox *poCheckBoxDepth = new QCheckBox("Z轴展示深度");
    poCheckBoxDepth->setChecked(false);

    eZValue = Z_TOTAL;

    poButtonGroup->addButton(poCheckBoxTotal, Z_TOTAL);
    poButtonGroup->addButton(poCheckBoxDepth, Z_DEPTH);
    connect(poButtonGroup, &QButtonGroup::buttonClicked, this, [=](QAbstractButton *button){
        eZValue = static_cast<Z_VALUE>(poButtonGroup->buttons().indexOf(button));

        if (m_ChartViewer->needUpdateChart())
            drawChart(m_ChartViewer);

    });

    QVBoxLayout *poVBoxLayout = new QVBoxLayout;
    poVBoxLayout->addStretch();
    poVBoxLayout->addWidget(m_DrawFrameOnRotate, 0, Qt::AlignLeft);
    poVBoxLayout->addWidget(poCheckBoxTotal, 0, Qt::AlignLeft);
    poVBoxLayout->addWidget(poCheckBoxDepth, 0, Qt::AlignLeft);
    poVBoxLayout->addStretch();

    // Chart Viewer
    m_ChartViewer = new QChartViewer(this);
    connect(m_ChartViewer, SIGNAL(viewPortChanged()),SLOT(onViewPortChanged()));
    connect(m_ChartViewer, SIGNAL(mouseMove(QMouseEvent *)), SLOT(onMouseMoveChart(QMouseEvent *)));
    connect(m_ChartViewer, SIGNAL(clicked(QMouseEvent *)), SLOT(onMouseUpChart(QMouseEvent *)));

    // Set initial zoom/scroll direction
    m_ChartViewer->setScrollDirection(Chart::DirectionHorizontalVertical);
    m_ChartViewer->setZoomDirection(Chart::KeepAspectRatio);


    // Enable mouse wheel zooming by setting the zoom ratio to 1.1 per wheel event
    m_ChartViewer->setMouseWheelZoomRatio(1.1);

    QHBoxLayout *poHBoxLayout = new QHBoxLayout;
    poHBoxLayout->addLayout(poVBoxLayout, 0);
    poHBoxLayout->addWidget(m_ChartViewer, 1, Qt::AlignCenter);

    this->setLayout(poHBoxLayout);

    // 3D view angles
    m_elevationAngle = 30;
    m_rotationAngle = 45;

    // Keep track of mouse drag
    m_isDragging = false;
    m_lastMouseX = -1;
    m_lastMouseY = -1;

    // Update the viewport to display the chart
    m_ChartViewer->updateViewPort(true, false);

    this->title = title;

    this->adX = adX;
    this->adY = adY;
    this->adZ = adZ;
    this->adW = adW;

    this->minX = minX;
    this->maxX = maxX;

    this->minY = minY;
    this->maxY = maxY;

    this->minZ = minZ;
    this->maxZ = maxZ;

    this->minW = minW;
    this->maxW = maxW;

    this->size = size;
}

ThreeDChartRotation::~ThreeDChartRotation()
{
    delete m_ChartViewer->getChart();
}

//
// View port changed event
//
void ThreeDChartRotation::onViewPortChanged()
{
    // Update the chart if necessary
    if (m_ChartViewer->needUpdateChart())
        drawChart(m_ChartViewer);
}

//
// Draw chart
//
void ThreeDChartRotation::drawChart(QChartViewer *poChartViewer)
{
    SurfaceChart* poSurfaceChart = new SurfaceChart(this->width(), this->height(), 0xffffff, 0x888888);

    poSurfaceChart->setPerspective(20);

    poSurfaceChart->addTitle(title.toUtf8(), "Arial Bold Italic", 16);

    poSurfaceChart->setPlotRegion(this->width()/2, this->height()/2, this->height()/qSqrt(2), this->height()/qSqrt(2), this->height()/qSqrt(2)*0.618);
    QString oStrLabel, oStrZAxisTitle;

    switch (eZValue) {
    case Z_TOTAL:
        poSurfaceChart->setData(DoubleArray(adX, size), DoubleArray(adY, size), DoubleArray(adW, size));
        oStrZAxisTitle = "总场(mV)";
        oStrLabel = "title='<*cdml*>经度(°): {x|10}<*br*>纬度(°): {y|10}<*br*>总场(mV): {z|6}'";
        break;
    case Z_DEPTH:
        poSurfaceChart->setData(DoubleArray(adX, size), DoubleArray(adY, size), DoubleArray(adZ, size), DoubleArray(adW, size));
        oStrZAxisTitle = "深度(m)";
        oStrLabel = "title='<*cdml*>经度(°): {x|10}<*br*>纬度(°): {y|10}<*br*>深度(m): {z|2}'";
        break;
    default:
        break;
    }

    poSurfaceChart->setInterpolation(80, 80);

    int majorGridColor = 0xc0000000;
    int minorGridColor = poSurfaceChart->dashLineColor(majorGridColor, Chart::DotLine);
    poSurfaceChart->setSurfaceAxisGrid(majorGridColor, majorGridColor, minorGridColor, minorGridColor);

    // Add XY projection
    poSurfaceChart->addXYProjection();

    // Set contour lines to semi-transparent white (0x7fffffff)
    poSurfaceChart->setContourColor(0x7fffffff);

    poSurfaceChart->setViewAngle(m_elevationAngle, m_rotationAngle);

    if (m_isDragging && m_DrawFrameOnRotate->isChecked()){
        poSurfaceChart->setShadingMode(Chart::RectangularFrame);
    }

    ColorAxis* poColorAxis = poSurfaceChart->setColorAxis(this->width() - 300, this->height()*0.1545, Chart::TopLeft, this->height()*0.618, Chart::Right);

     poColorAxis->setLabelStyle("Arial", 10);

     poColorAxis->setAxisBorder(Chart::Transparent, 0);

     poColorAxis->setTitle("总场(mV)", "Arial Bold", 15);

     poColorAxis->setLinearScale(minW, maxW, (maxW-minW)/20);

     int colorGradient[] = {0x9999FF,  0x0000CC,  0x00CC00,  0xFFFF00,  0xEE0000,  0xFF0000};
     const int colorGradient_size = (int)(sizeof(colorGradient)/sizeof(*colorGradient));
     poColorAxis->setColorGradient(false, IntArray(colorGradient, colorGradient_size));

    poSurfaceChart->xAxis()->setTitle("经度(°)", "Arial Bold Italic", 12);
    poSurfaceChart->yAxis()->setTitle("纬度(°)", "Arial Bold Italic", 12);
    poSurfaceChart->zAxis()->setTitle(oStrZAxisTitle.toUtf8(), "Arial Bold Italic", 12);

    delete poChartViewer->getChart();
    poChartViewer->setChart(poSurfaceChart);
    poChartViewer->setImageMap(poSurfaceChart->getHTMLImageMap("", "", oStrLabel.toUtf8()));
}

void ThreeDChartRotation::resizeEvent(QResizeEvent *event)
{
    m_ChartViewer->getChart()->setSize(event->size().width(), event->size().height());
}

void ThreeDChartRotation::onMouseMoveChart(QMouseEvent *event)
{
    int mouseX = m_ChartViewer->getChartMouseX();
    int mouseY = m_ChartViewer->getChartMouseY();

    // Drag occurs if mouse is moving and mouse button is down
    if (event->buttons() & Qt::LeftButton)
    {
        if (m_isDragging)
        {
            // The chart is configured to rotate by 90 degrees when the mouse moves from
            // left to right, which is the plot region width (360 pixels). Similarly, the
            // elevation changes by 90 degrees when the mouse moves from top to buttom,
            // which is the plot region height (270 pixels).
            m_rotationAngle += (m_lastMouseX - mouseX) * 90.0 / 360;
            m_elevationAngle += (mouseY - m_lastMouseY) * 90.0 / 270;
            m_ChartViewer->updateViewPort(true, false);
        }

        // Keep track of the last mouse position
        m_lastMouseX = mouseX;
        m_lastMouseY = mouseY;
        m_isDragging = true;
    }
}

void ThreeDChartRotation::onMouseUpChart(QMouseEvent *event)
{
    if (m_isDragging && (event->button() == Qt::LeftButton))
    {
        // mouse up means not dragging
        m_isDragging = false;
        m_ChartViewer->updateViewPort(true, false);
    }
}

仅仅是学习。

这里面有个数据网格化。使用反距离加权法插值。
//xyPosition:输入点坐标(X,Y)
//inScatterData:输入的散点(X,Y,Z)集合
//返回输入点插值所得到的Z

有数学大佬,可以给出更完美的克里金插值法,这样距离Golden Software的Surfer就又近了一步。

#include "GridWorker.h"

GridWorker::GridWorker(QSqlDatabase db, double dStep, double dCM, QObject *parent)
    : QObject{parent}
{
    this->db = db;

    this->dStep = dStep;

    this->dCM = dCM;
}

void GridWorker::run()
{
    QSqlQuery query(db);
    db.transaction();

    //检索极值,确定平面范围
    double maxLon = 0.0, minLon = 0.0, maxLat = 0.0, minLat = 0.0;

    query.clear();
    query.exec("select min(longitude), max(longitude), min(latitude),  max(latitude) from merge");

    if(query.first()){
        minLon = query.value(0).toDouble();
        maxLon = query.value(1).toDouble();

        minLat = query.value(2).toDouble();
        maxLat = query.value(3).toDouble();
    }

    qDebugV0()<<QString::number(minLon, 'f', 8)
               <<QString::number(maxLon, 'f', 8)
               <<QString::number(minLat, 'f', 8)
               <<QString::number(maxLat, 'f', 8);

    qDebugV0()<<QString::number((maxLon - minLon), 'f', 8)<<QString::number((maxLat - minLat), 'f', 8);


    //Vector 3D,选取 需要出图的关键数据
    QScatterDataArray *poArrayDepth = new QScatterDataArray;
    QScatterDataArray *poArrayTotal = new QScatterDataArray;

    query.clear();
    query.exec("select longitude, latitude, depth, total from merge");

    while(query.next()){

        poArrayDepth->append(QVector3D(query.value("longitude").toDouble(),
                                       query.value("latitude").toDouble(),
                                       query.value("depth").toDouble()));

        poArrayTotal->append(QVector3D(query.value("longitude").toDouble(),
                                       query.value("latitude").toDouble(),
                                       query.value("total").toDouble()));
    }

    //contour 存到数据库 表里面
    query.clear();

    query.exec("delete from contour");

    query.prepare(QString("insert into contour values(?, ?, ?, ?)"));

    QVariantList arLongitude, arLatitude, arDepth, arTotal;

    QPair<double, double> stepLonLat = this->getStep(maxLon, minLon, maxLat, minLat, dStep);

    double dStepLon = stepLonLat.first;
    double dStepLat = stepLonLat.second;

    qDebugV0()<<"距离, 纬度  经度 rate: "<<(maxLat-minLat)/dStepLat<<(maxLon-minLon)/dStepLon;

    double dCnt = (maxLat-minLat)/dStepLat * (maxLon-minLon)/dStepLon;


        quint32 uiPercentage = PROGRESS_STEP;

    for(double lon = minLon; lon < maxLon; lon += dStepLon){

        //emit sigProgress(100*(lon - minLon)/(maxLon-minLon) , QString("lon, (%1/%2)").arg((lon - minLon)/dStepLon).arg((maxLon-minLon)/dStepLon));

        for(double lat = minLat; lat < maxLat; lat += dStepLat){

            //根据给定的 x y ,计算出 网格化的结果 总场值,
            QVector3D vDepth = this->calIDW(poArrayDepth, QVector2D(lon, lat));
            QVector3D vTotal = this->calIDW(poArrayTotal, QVector2D(lon, lat));

            arLongitude.append(vTotal.x());
            arLatitude.append(vTotal.y());
            arDepth.append(-1*vDepth.z());
            arTotal.append(vTotal.z());

            float fProgress = (lon - minLon)/(maxLon-minLon) * (lat - minLat)/(maxLat-minLat) * 100;

            if(fProgress >= uiPercentage)
            {
                emit sigProgress(fProgress , "数据网格化~");

                uiPercentage = uiPercentage + PROGRESS_STEP;
            }

        }
    }

    query.addBindValue(arLongitude);
    query.addBindValue(arLatitude);
    query.addBindValue(arDepth);
    query.addBindValue(arTotal);

    query.execBatch(); //进行批处理操作
    db.commit();

    emit sigProgress(100, QString("网格化完毕!"));
}

//反距离加权法插值
//xyPosition:输入点坐标(X,Y)
//inScatterData:输入的散点(X,Y,Z)集合
//返回输入点插值所得到的Z
QVector3D GridWorker::calIDW(QScatterDataArray *poArray, QVector2D vector2D)
{
    double result = 0;

    int inNum = poArray->count();

    QVector<double> di;

    di.resize(inNum);

    double sum_di = 0;

    for(int i = 0; i < inNum; i++)
    {
        double dis = sqrt(pow(vector2D.x() - poArray->at(i).x(), 2) + pow(vector2D.y() - poArray->at(i).y(), 2));

        if(dis == 0){
            return  QVector3D(vector2D.x(), vector2D.y(), poArray->at(i).z());
        }

        di[i] = 1.0/pow(dis, 2);

        sum_di += (di[i]);
    }

    for(int i = 0; i < inNum; i++){
        result += ((di[i]/sum_di) * poArray->at(i).z());
    }

    QVector<double>().swap(di);

    //qDebugV0()<< QString::number(vector2D.x(), 'f', 10)<<","<< QString::number(vector2D.y(), 'f', 10)<<","<< QString::number(result, 'f', 10) ;

    return QVector3D(vector2D.x(), vector2D.y(), result);
}

QPair<double, double> GridWorker::getStep(double maxLon,double minLon, double maxLat, double minLat, double dStep)
{
    XYZ oXYZLB = BLToGauss((minLon), (minLat));//左下角

    XYZ oXYZRB = BLToGauss((maxLon), (minLat));//右下角

    XYZ oXYZLT = BLToGauss((minLon), (maxLat));//左上角

    double dLengthLon = oXYZRB.y - oXYZLB.y;//东西方向的 距离
    double dLengthLat = oXYZLT.x - oXYZLB.x;//南北方向的 距离

    qDebugV0()<<"距离, 南北  东西     : "<<dLengthLat<<dLengthLon;
    qDebugV0()<<"距离, 纬度  经度 rate: "<<dLengthLat/dStep<<dLengthLon/dStep;

//    qDebugV0()<<"距离, 纬度  经度 mi: "<<dLengthLat<<dLengthLon;
//    qDebugV0()<<"距离, 纬度  经度 du: "<<(maxLat-minLat)<<(maxLon-minLon);

    QPair<double, double> stepLonLat;
    stepLonLat.first  = dStep/dLengthLon*(maxLon-minLon);//东西方向的 经度 步长 单位是度 度
    stepLonLat.second = dStep/dLengthLat*(maxLat-minLat);//南北方向的 纬度 步长 单位是度 度

    return stepLonLat;
}

/**
 * 由经纬度反算成高斯投影坐标(高斯正算)
 *
 * @param longitude
 * @param latitude
 */
XYZ GridWorker::BLToGauss(double longitude, double latitude)
{
    int ProjNo = 0;

    // 带宽
    int ZoneWide = 3;

    double longitude1, latitude1, longitude0, X0, Y0, xval, yval;
    double a, f, e2, ee, NN, T, C, A, M, iPI;

    // 3.1415926535898/180.0;
    iPI = M_PI/180.0;

    // 84年北京坐标系参数
    a = 6378137;
    f = 1.0 / 298.2572236;

    //CGCS2000坐标系参数
    //    a = 6378137;
    //    f = 1.0 / 298.2572221;

    ProjNo = 0;
    longitude0 = ProjNo * ZoneWide ;
    longitude0 = dCM * iPI;

    // 经度转换为弧度
    longitude1 = longitude * iPI;

    // 纬度转换为弧度
    latitude1 = latitude * iPI;

    e2 = 2 * f - f * f;
    ee = e2 * (1.0 - e2);
    NN = a / sqrt(1.0 - e2 * sin(latitude1) * sin(latitude1));
    T = tan(latitude1) * tan(latitude1);
    C = ee * cos(latitude1) * cos(latitude1);
    A = (longitude1 - longitude0) * cos(latitude1);
    M = a * ((1 - e2 / 4 - 3 * e2 * e2 / 64 - 5 * e2 * e2 * e2 / 256) * latitude1 - (3 * e2 / 8 + 3 * e2 * e2 / 32 + 45 * e2 * e2 * e2 / 1024) * sin(2 * latitude1) + (15 * e2 * e2 / 256 + 45 * e2 * e2 * e2 / 1024) * sin(4 * latitude1) - (35 * e2 * e2 * e2 / 3072) * sin(6 * latitude1));
    xval = NN * (A + (1 - T + C) * A * A * A / 6 + (5 - 18 * T + T * T + 72 * C - 58 * ee) * A * A * A * A * A / 120);
    yval = M + NN * tan(latitude1) * (A * A / 2 + (5 - T + 9 * C + 4 * C * C) * A * A * A * A / 24 + (61 - 58 * T + T * T + 600 * C - 330 * ee) * A * A * A * A * A * A / 720);
    X0 = 1000000 * (ProjNo ) + 500000;
    Y0 = 0;
    xval = xval + X0;
    yval = yval + Y0;

    XYZ oXYZ;
    oXYZ.x = yval;
    oXYZ.y = xval;

    qDebugV0()<<"x: "<<QString::number(oXYZ.x, 10, 3)<<"     y: "<<QString::number(oXYZ.y, 10, 3);

    return oXYZ;
}

python pychartdir模块的安装及使用 python中要使用pychartdir的绘图的话需要安装pychartdir模块,其安装方法不同于其他python模块的安装。 1.先下载pychartdir,可从官网http://www.advsofteng.com/download.html下载对应的zip包(ChartDirector for Python) 2.解压前需要先 Remember to unblock the Z 阅读详情

相关推荐

Qt按钮组按下任意按钮触发信号和槽

项目闲谈,想到了就发了。老样子,如果有帮助万分荣幸,没帮助只能“诶嘿~”

m0_58509028的博客 2036

ChartDirector 6.3(C ++版)教程分享——图标饼图

ChartDirector是一款使用方便快捷、功能非常强大且交互性强的通用Web图表组件。在Web服务器以及嵌入式应用程序开发中,ChartDirector是一个非常理想的图表工具,因为它拥有丰富的图表图形组件库。一、图标饼图(一)此示例演示如何使用CDML和参数替换格式化在扇区标签中包含图标。它还演示了渐变背景颜色,标题的玻璃着色效果和图表框的圆角。 渐变背景颜色使用Chart.metalCo...

weixin_34239592的博客 596

15.4 普通克里金插值

1、加载数据2.半方差云图分析 3.克里金插值,打开空间统计向导 用象限搜索 查看均方根误差 自动优化选择模型 各向异性查看各项指标,衡量插值效果 4.导出结果 5.按边界掩膜提取 符号化配置...

m0_68095107的博客 721

ChartDirector 6.3(C ++版)教程分享——简单条形图

ChartDirector是一个非常理想的图表工具,它拥有广泛的图表类型、分层架构、实时互动的大数据表、普遍适应于各种应用程序以及支持PDF和SVG图标等的优点。此系列连载旨在介绍ChartDirector的实用教程,供大家学习讨论。一、简单条形图(一)此示例演示了创建条形图的基本步骤:使用XYChart.XYChart创建XYChart对象。使用XYChart.setPlotArea指定图表的绘...

weixin_34289454的博客 1163

Creator 中使用 Qwt 插件

1.自行网上搜索qwt-6.0.1源码,并下载下来。 2.解压(改路径不能有存在空格名称的文件路径) 3.打开qtcreator  open projects->找到解压后的qwt-6.0.1中的qwt.pro文件->open。 4. 修改为 5.build->clean all->run qmake。clean all的作用是防止你以前编译失败的文件运行,

qingshu513的专栏 636

深入理解克里金插值法:原理与C++实现

本文详细介绍了克里金插值的原理及其C++实现,并通过实际例子展示了克里金插值的应用。克里金插值作为一种强大的空间插值方法,在地质、环境科学等领域具有广泛的应用前景。通过本文的讲解,读者可以深入理解克里金插值的基本概念、计算方法和实际应用。在实际项目中,可以根据具体需求选择合适的克里金插值方法,并结合优化技术提高计算效率和预测精度。希望本文能为读者在空间数据分析和预测方面提供有益的参考。在将以上内容发布到优快云时,确保公式和代码片段的格式正确。公式可以使用 $$ 包围,以确保显示正确。

qq_38334677的博客 2445

c++ 中使用ChartDirector输出图表的网页

http://blog.chinaunix.net/uid-7671779-id-2599207.htmlChartDirector是一个很好用的生成图表的库,用c++开发,提供了c++接口.  文件:chartdir_cpp_win32.zip大小:4877KB下载:下载现在以安装包中带的softlightbar文件夹中的工程为例,把图表输出到网页 1,先把工程的输出文件设为.cgi扩展名2,工

Augusdi的专栏 3448

chartdir(教你轻轻松松制作各种图表)

一款很好用的web做图软件(柱状图,曲线图,饼状图等等),安装后有附带的帮助文档,文档中有各种图表的简单示例,教你轻轻松松制作各种web图表。

克里金算法C++版本

克里金高维插值算法的c++版本

Happygirl_ajiao的博客 1596

等值线处理程序(离散数据)

本程序是我花了几个月的时间写出来的,可以对离散数据和网格数据进行处理的等值线程序,图形效果很好,使用起来也很方便。 本程序使用了开源的Qt来发图形设计,所以设计了qt代码的部分将开源公布,而其他未涉及Qt代码的部分将暂不公布。 有关该程序的使用方法和其他的一些介绍你可以访问blog:http://blog.youkuaiyun.com/jianjun365222 本程序是在Linux debian 2.6.26-1-686编译通过的。

基于Visual Studio编译的无人机地面站系统源码

先进飞行器智能控制系统核心程序代码,专为高效集成与学术研究设计。 资源来源于网络分享,仅用于学习交流使用,请勿用于商业,如有侵权请联系我删除!

等高线数据的绘制

0.前提条件是有高程文件,这个需要单独购买 1.下载GlobalMapper14 2.安装 3.将.tif文件拖拽进界面,如果是多个高程文件,最好分批次拖进。将视图缩小就会看到加载的各个图片块, 4.点击分析->生成等高线,就可以绘出等高线图,这个需要等待几分钟 ...

martinkeith的博客 2353

六轴机械臂正逆解计算

机械臂运动学就是。包括(Forward Kinematics)和(InverseKinematics)两部分。正运动学就是逆运动学则是关节变量->机械臂末端执行器的姿势=正向运动学机械臂未端执行器的位姿->关节变量=逆向运动学。

gaoxiaochan的博客 1万+

Qt之2D绘图

Qt中提供了强大的2D绘图系统,可以使用相同的API在屏幕和绘图设备上进行绘制,主要基于QPainter、QPaintDevice和QPaintEngine这3个类。其中,QPainter类用来执行绘图操作;QPaintDevice类提供绘图设备(绘图设备类QPaintDevice是所有可以绘制的对象的基类,它的子类主要有QWidget、QPixmap、QPicture、QImage和QPrint

梦之队2014---http://blog.youkuaiyun.com/hlb0924 1867

微信群消息监控系统实战:从零搭建Python自动化监控平台

本文详细介绍了如何从零搭建Python微信群消息监控系统,实现自动化监控和记录群消息。通过wxauto库模拟人工操作微信,结合MySQL数据库存储和智能去重策略,系统能高效处理大量消息并支持关键词监控。文章还分享了性能优化、安全合规等实战经验,帮助开发者快速构建高效稳定的监控平台。

weixin_29091105的博客 319

ALTERA MAX10 FPGA 串口远程升级实战:从原理到烧录的避坑指南

本文详细解析了ALTERA MAX10 FPGA如何通过串口实现远程升级。文章从工程师实战经验出发,深入剖析了MAX10片内Flash的双镜像备份原理、CONFIG_SEL引脚启动机制,并重点介绍了使用On-Chip Flash IP核进行擦写操作的核心流程。同时,提供了从Quartus工程配置、RPD文件生成、串口协议设计到驱动代码编写的完整避坑指南,旨在帮助开发者稳定、高效地完成远程升级功能部署。

weixin_29197699的博客 273

C/C++ Qt 数据库与Chart实现历史数据展示

在前面的博文中具体介绍了QChart组件是如何绘制各种通用的二维图形的,本章内容将继续延申一个新的知识点,通过数据库存储某一段时间节点数据的走向,当用户通过编辑框提交查询记录时,程序自动过滤出该时间节点下所有的数据,并将该数据动态绘制到图形组件内,实现动态查询图形的功能。接着编写一个模拟插入数据的案例,该案例每一秒向数据库内插入一条记录,我们运行一段时间。lyshark (王瑞)

hw5230的博客 854

CentOS7下Node.js v20+安装与常见依赖库问题解决指南

本文详细介绍了在CentOS7系统下安装Node.js v20+的完整流程及常见依赖库问题的解决方案。通过升级glibc到2.28+、配置环境变量以及处理libstdc++版本问题,帮助开发者顺利在老旧系统上部署最新版Node.js,提升开发效率。

weixin_30689307的博客 156

C++学习笔记

学习谭浩强编著的《C++程序设计》过程中的一些笔记,mark一下,好记性不如烂笔头 1、CPP内置函数inline 在编译时将所有调用函数的代码嵌入主函数中, 可以在函数声明处最左端添加关键词 inline,也可以在函数处添加,也可以两处都添加 内置函数不能包括复杂的控制语句,如循环语句和switch语句 2、重载函数:一名多用 函数名相同,参数个数或者参数类型或者参数循序不同 3、函数模板(泛型)function template template T max(T a, T b, T c){ if(.

Song 485

冷门但实用:Python爬取微信公众号历史文章,突破微信反爬限制(2025有效)

2025年微信公众号爬取的核心是「冷门方法+指纹伪装」,而非常规接口破解,itchat-uos+Playwright组合是突破设备指纹的关键;登录态持久化、动态Token实时获取、频率严格控制是避免被封禁的三大核心;文章内容解析需解决2025新增的编码混淆问题,chardet+BeautifulSoup是冷门但有效的方案;合规是前提,爬取频率、数据用途需严格遵守平台/法律规则。

专注于Python爬虫开发,分享爬虫技巧、项目实战与反爬经验,使用Scrapy、BeautifulSoup等工具,解决数据抓取难题。 3775

华为OD机试双机位C卷-字符串解密(Py/Java/C/C++/Js/Go)

华为OD机试(机考)双机位C卷 【字符串解密】,提供C语言、Java、C++、Python、Go、JavaScript源码实现,并提供完整思路讲解,以及在线OJ模拟做题。华为OD机试 - 字符串解密。

qq_45776114的博客 732

Qt中的二维图形(二)

要想在绘图设备上绘图,只需创建一个QPainter,再将指针传到该设备中,例如: void MyWidget::paintEvent(QPainter *event) {        QPainter painter(this);        ............ } 使用QPainter的draw...()函数,可以绘制各种各样的形状。一些重要函数如下图。绘制的效果主要取

q5512049的博客 1404

手把手教你学Simulink——基于Simulink的滑模控制器车辆稳定性仿真建模示例

本文详细介绍了基于Simulink的滑模控制器在车辆稳定性控制中的应用。通过建立二自由度车辆动力学模型(含魔术公式轮胎),设计横摆角速度与质心侧偏角滑模控制器,在Simulink中实现直接横摆力矩控制。文章包含完整的建模流程:从参考模型设计、滑模控制器推导(含等效控制和边界层法),到MATLAB参数设定和Simulink模块搭建。通过双移线测试和路面突变场景验证,证明该控制器能在低附着路面(μ=0.3)将横摆角速度误差控制在±5%以内,显著提升车辆稳定性。同时提供了工程实践要点和扩展方向(如高阶滑模、自适应

MHD0815的博客 106
上一篇: QCustomPlot 共用X轴多Y轴绘制多条曲线
下一篇: Windows Qt C++ VTK 借助msys环境搭建
QQ_278397935
博客等级 码龄18年 120粉丝 32原创
评论 1
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值