| 1872 | } |
| 1873 | |
| 1874 | void CartesianPlot::addHorizontalAxis() { |
| 1875 | DEBUG(Q_FUNC_INFO) |
| 1876 | Axis* axis = new Axis(QStringLiteral("x-axis"), Axis::Orientation::Horizontal); |
| 1877 | addChild(axis); |
| 1878 | axis->setSuppressRetransform(true); // retransformTicks() needs plot |
| 1879 | axis->setCoordinateSystemIndex(defaultCoordinateSystemIndex()); |
| 1880 | if (axis->rangeType() == Axis::RangeType::Auto) { |
| 1881 | axis->setUndoAware(false); |
| 1882 | // use x range of default plot range |
| 1883 | axis->setRange(range(Dimension::X)); |
| 1884 | axis->setMajorTicksNumber(range(Dimension::X).autoTickCount()); |
| 1885 | axis->setUndoAware(true); |
| 1886 | } |
| 1887 | axis->setSuppressRetransform(false); |
| 1888 | axis->retransform(); |
| 1889 | } |
| 1890 | |
| 1891 | void CartesianPlot::addVerticalAxis() { |
| 1892 | Axis* axis = new Axis(QStringLiteral("y-axis"), Axis::Orientation::Vertical); |