| 744 | } |
| 745 | |
| 746 | void CartesianPlotTest::invalidStartValueLogScaling() { |
| 747 | Project project; |
| 748 | |
| 749 | Spreadsheet* sheet = new Spreadsheet(QStringLiteral("Spreadsheet"), false); |
| 750 | project.addChild(sheet); |
| 751 | |
| 752 | sheet->setColumnCount(3); |
| 753 | sheet->setRowCount(3); |
| 754 | |
| 755 | sheet->column(0)->setColumnMode(AbstractColumn::ColumnMode::Double); |
| 756 | sheet->column(1)->setColumnMode(AbstractColumn::ColumnMode::Double); |
| 757 | sheet->column(2)->setColumnMode(AbstractColumn::ColumnMode::Double); |
| 758 | |
| 759 | sheet->column(0)->setValueAt(0, 0.); |
| 760 | sheet->column(0)->setValueAt(1, 1.); |
| 761 | sheet->column(0)->setValueAt(2, 2.); |
| 762 | |
| 763 | sheet->column(1)->setValueAt(0, 0.); |
| 764 | sheet->column(1)->setValueAt(1, 1.); |
| 765 | sheet->column(1)->setValueAt(2, 2.); |
| 766 | |
| 767 | sheet->column(2)->setValueAt(0, 0.00001); |
| 768 | sheet->column(2)->setValueAt(1, 0.1); |
| 769 | sheet->column(2)->setValueAt(2, 1.); |
| 770 | |
| 771 | auto* worksheet = new Worksheet(QStringLiteral("Worksheet")); |
| 772 | project.addChild(worksheet); |
| 773 | |
| 774 | auto* plot = new CartesianPlot(QStringLiteral("plot")); |
| 775 | worksheet->addChild(plot); |
| 776 | plot->setType(CartesianPlot::Type::TwoAxes); // Otherwise no axis are created |
| 777 | |
| 778 | // Create new cSystem |
| 779 | Range<double> xRange; |
| 780 | xRange.setFormat(RangeT::Format::Numeric); |
| 781 | Range<double> yRange; |
| 782 | yRange.setFormat(RangeT::Format::Numeric); |
| 783 | yRange.setScale(RangeT::Scale::Log10); |
| 784 | plot->addXRange(xRange); |
| 785 | plot->addYRange(yRange); |
| 786 | CartesianCoordinateSystem* cSystem = new CartesianCoordinateSystem(plot); |
| 787 | cSystem->setIndex(Dimension::X, 1); |
| 788 | cSystem->setIndex(Dimension::Y, 1); |
| 789 | plot->addCoordinateSystem(cSystem); |
| 790 | plot->setNiceExtend(false); |
| 791 | |
| 792 | auto* curve1 = new XYCurve(QStringLiteral("curve1")); |
| 793 | plot->addChild(curve1); |
| 794 | |
| 795 | curve1->setXColumn(sheet->column(0)); |
| 796 | curve1->setYColumn(sheet->column(1)); |
| 797 | curve1->setCoordinateSystemIndex(1); |
| 798 | |
| 799 | QCOMPARE(plot->rangeFormat(Dimension::X, 0), RangeT::Format::Numeric); |
| 800 | QCOMPARE(plot->rangeFormat(Dimension::Y, 0), RangeT::Format::Numeric); |
| 801 | QCOMPARE(plot->rangeFormat(Dimension::X, 1), RangeT::Format::Numeric); |
| 802 | QCOMPARE(plot->rangeFormat(Dimension::Y, 1), RangeT::Format::Numeric); |
| 803 |
nothing calls this directly
no test coverage detected