! * Creates an chart with the given \a size and insert * at the position \a row, \a column. * The chart will be returned. */
| 1190 | * The chart will be returned. |
| 1191 | */ |
| 1192 | Chart *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 |
nothing calls this directly
no test coverage detected