Skip to content

How to do a X-Y scatter plot #407

@nitrogene

Description

@nitrogene

Hello,

I am trying to insert a X-Y Scatter plot without success. Here's and example of used code:

...
insertColumn("totalLengthTheoretical-totalLengthReal", 7, totalLengthDiffValues, xlsxW);
{
    auto chart = xlsxW.insertChart(20, 9, QSize(300, 300));
    chart->setChartType(QXlsx::Chart::CT_ScatterChart);
    chart->addSeries(QXlsx::CellRange(QString("A1:A%1").arg(2+nbValues)));
    chart->addSeries(QXlsx::CellRange(QString("H1:H%1").arg(2+nbValues)));
    chart->setChartTitle("totalLength");
 }
...

But the output is not as expected:

Image

How can I specify that first series are X values, and second series are Y values ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions