FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Feat: add logarithmic scale option for X and Y axes in Plot window by Negi2110 · Pull Request #4158 · sqlitebrowser/sqlitebrowser · GitHub

Feat: add logarithmic scale option for X and Y axes in Plot window - #4158

Merged
mgrojo merged 3 commits into
sqlitebrowser:masterfrom
Negi2110:feat/logarithmic-axis-plot
Jul 29, 2026
Merged

Feat: add logarithmic scale option for X and Y axes in Plot window#4158
mgrojo merged 3 commits into
sqlitebrowser:masterfrom
Negi2110:feat/logarithmic-axis-plot

Conversation

Negi2110 commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Closes #4111

What this PR does

Adds logarithmic scale support for the X and Y axes in the Plot window,
accessible via two new options in the plot's right-click context menu:

  • "Logarithmic scale (X)"
  • "Logarithmic scale (Y)"

Implementation

Follows the same pattern as existing toggleable plot options
(Show legend, Stacked bars, Fixed number format):

  • Added m_logScaleX and m_logScaleY bool members to PlotDock
  • Added updateLogScale() function that calls QCPAxis::setScaleType()
    on xAxis, yAxis, and yAxis2
  • Added two checkable QAction entries to the context menu
  • Called updateLogScale() after rescaleAxes() in updatePlot() so
    the scale type is reapplied whenever the plot data changes
  • Guards against log(0): clamps axis range minimum to 1e-3 when
    switching to log scale with a non-positive lower bound

How to test

  1. Open a database with numeric data
  2. Go to Browse Data → Plot tab
  3. Select a numeric column as X and another as Y1
  4. Right-click the plot → toggle "Logarithmic scale (Y)"
  5. Y axis switches to logarithmic spacing
  6. Toggle off → returns to linear
  7. Same works for "Logarithmic scale (X)"

Comment thread src/PlotDock.cpp
Comment thread src/PlotDock.cpp

Copy link
Copy Markdown
Contributor Author

Not a draft — this should be ready for review. I've addressed the two issues you flagged (fixedFormatsAction connection restored, and log-scale ticker added) in the latest commits.

One more thing worth flagging: macOS CI (macos-14 SQLCipher and macos-14 SQLite) is failing at the brew tap step:

Error: Refusing to load formula sqlitebrowser/tap/sqlb-qt@5 from untrusted tap sqlitebrowser/tap.
This happens before the build starts and looks unrelated to this PR's changes — let me know if this needs anything from my end or if it's a known issue.

Copy link
Copy Markdown
Contributor

This happens before the build starts and looks unrelated to this PR's changes — let me know if this needs anything from my end or if it's a known issue.

This is a known issue which someone with enough experience should look into, but if ever, it belongs to a dedicated PR.

mgrojo commented Jul 29, 2026

Copy link
Copy Markdown
Member

Perfect! Thanks for the implementation and addressing the comments, @Negi2110.

mgrojo merged commit 5600026 into sqlitebrowser:master Jul 29, 2026
21 of 23 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Plot Window Logarithmic axis

3 participants


Back | FazBrowse Home | New Git URL