KChart: Fix bug in xAxisStartAtZero and add ditto for y-axis
Needs ReviewPublic

Authored by danders on Mar 21 2018, 10:21 AM.

Details

Reviewers
tbaumgart
Summary

The implementation of xAxisStartAtZero did correspond to api doc,
and imo did not do anything interresting.

This patch makes it possible to force the axes to always start at zero.

Test Plan

See tests/AxisStartAtZero

Diff Detail

Repository
R478 KDiagram: Libraries for diagrams
Branch
axisstartatzero_danders
Lint
No Linters Available
Unit
No Unit Test Coverage
danders requested review of this revision.Mar 21 2018, 10:21 AM
danders created this revision.
tbaumgart requested changes to this revision.Mar 23 2018, 7:39 PM

I am missing the version change for this patch. Increasing the micro version should be enough since only a new method is added. I am not sure though if that is still ABI compatible.

src/KChart/Cartesian/KChartCartesianCoordinatePlane.cpp
59

Does it make sense to change the default? Existing software is certainly affected by this change. I would keep compatibility here and set it to true.

60

Same applies here even though the setting did not exist before. Keep it backward compatible which seems to be the case for false.

413

I would not check here. It does not hurt to do the assignment in any case even with the same value but safes the comparison operation in all cases.

This revision now requires changes to proceed.Mar 23 2018, 7:39 PM

Thanks for your comments.
I have had some second thoughts about this and will probably find a different way to do it or at least not reuse xAxisStartAtZero (although I think it is very broken).
Anyhow it will not get in until 2.7

src/KChart/Cartesian/KChartCartesianCoordinatePlane.cpp
59

Before false actually meant: "never start at zero", so the default is actually not changed :)

413

I included it because it is the way it is done in all setters, but as you say it is probably not necessary.

danders updated this revision to Diff 31727.Apr 9 2018, 9:25 AM
  • Merge branch 'master' into axisstartatzero_danders
  • KChart: Make it possible to disable auto adjustment of axis range to data values

Hmm, I haven't quite figured out what arc does, so here comes a short description:

  1. Leaves the xAxisStartAtZero stuff as is in current release.
  2. Depricates xAxisStartAtZero stuff as it does not work as advertized and is buggy. Will be removed in 3.0.
  3. Add new functions to enable/disable auto adjustment of axes.
  4. Add the new functionality to tests/AxisControl.