MCPcopy Create free account
hub / github.com/KDE/labplot / insertChart

Method insertChart

src/3rdparty/QXlsx/source/xlsxworksheet.cpp:1192–1213  ·  view source on GitHub ↗

! * Creates an chart with the given \a size and insert * at the position \a row, \a column. * The chart will be returned. */

Source from the content-addressed store, hash-verified

1190 * The chart will be returned.
1191 */
1192Chart *Worksheet::insertChart(int row, int column, const QSize &size)
1193{
1194 Q_D(Worksheet);
1195
1196 if (!d->drawing)
1197 d->drawing = std::make_shared<Drawing>(this, F_NewFromScratch);
1198
1199 DrawingOneCellAnchor *anchor = new DrawingOneCellAnchor(d->drawing.get(), DrawingAnchor::Picture);
1200
1201 /*
1202 The size are expressed as English Metric Units (EMUs). There are
1203 12,700 EMUs per point. Therefore, 12,700 * 3 /4 = 9,525 EMUs per
1204 pixel
1205 */
1206 anchor->from = XlsxMarker(row, column, 0, 0);
1207 anchor->ext = size * 9525;
1208
1209 QSharedPointer<Chart> chart = QSharedPointer<Chart>(new Chart(this, F_NewFromScratch));
1210 anchor->setObjectGraphicFrame(chart);
1211
1212 return chart.data();
1213}
1214
1215/*!
1216 Merge a \a range of cells. The first cell should contain the data and the others should

Callers

nothing calls this directly

Calls 3

XlsxMarkerClass · 0.85
setObjectGraphicFrameMethod · 0.80
dataMethod · 0.45

Tested by

no test coverage detected