Two new options added to the context menu of the plot:
- Stacked bars: switches between stacked bars or grouped bars. The former
overlapped layout is avoided since it doesn't make much sense.
- Show legend: toggles the display of a plot legend with a translucent
background. Possible future improvement is dragging the legend with the
mouse.
Now that we have a proper type column in the plot selection widget, the
internal type storing can be simplified.
If the plot has more than one Y selections for one X of label type (bar
charts) the first bar is opaque, but the additional are translucent in
order to be seen, since they will overlap.
What's This information added to explain all the possible selections for
plotting.
String type columns are now selectable as X axis. In that case a bar chart
is plotted where the column values are used as bar labels.
A new Axis Type column is added to the axis selection table, so the user
knows before-hand how the plot will be drawn.
Line type and point shape combo-boxes are not enabled for bar charts, since
they don't make sense.
Columns that make no sense for the Y axis as strings and date/times are not
selectable for that axis.
Make use of signals to connect the selection in plot to the associated
table widget. Every time that the plot is updated from the Main Window
the table widget associated to the table or query is connected to the plot
and the previous widget is disconnected. This allows the selection of the
correct table widget.
Line selection methods moved to the Extended Table Widget to be used as
slots for this connection.
The destroyed signal is also connected for resetting the plot. This fixes
a crash that already existed before this PR, when closing a SQL tab while
the plot is still associated to the table results model.
Three different date/time data types are detected and appropriately
displayed in the axis:
- DateTime: "yyyy-MM-dd\nhh:mm:ss"
- Date: "yyyy-MM-dd"
- Time: "hh:mm:ss"
Now that the plot may contain graphs and curves, the plottableCount()
function must be used instead of graphCount() for checking whether the plot
has any plotted items.
This had the effect reported in issue #821 of breaking the enable check for
the fetch-all button.
The tables/queries sorted by X are drawn using QCPGraph as before.
Since QCPGraph does automatically sort by X, we change to QCPCurve that
requires a third data vector to reflect the order. We get that from the
current row order.
In the case of curves, only None and Line is supported as line style.
Since the order is now important for the plot, it is automatically updated
whenever the user sorts by another column in the browsed table.
This addresses issue #821 and indirectly fixes the problem of incorrect
point->row selection link when the table is not sorted by X, reported in
issue #838.
Avoid inheriting the style sheet in child widgets by naming the widget
type where it is set.
This had the effect, reported in issue #838, of setting an unwanted style
in child widgets, like the tool-tip of the "Load all data" button, the
tool-tip of the SQL results pane or the context menu of the search-bar
edit line.
This crash was introduced in 6d3228a0e3. It
happened when no previous settings were saved for the plot.
Additionally the plot interaction are set once for the plot widget.
This was reported at issue #838.
Warn user if not all data has been fetched and hint about the button for
loading all the data. The attention to this button is attracted changing
its background to a reddish colour and showing a warning in its tool-tip,
which is automatically shown for its default duration.
Default message is simplified and the button is only enabled when it is
useful (users of non-big databases would never be distracted about the
fetching mechanism).
Since this button is also useful for resetting the zoom and axis range,
it is also enabled if the user performs one of these interactions over the
plot.
See discussion at issue #838.
By selecting the axis or the labels associated to the axis,the user can
restrict the subsequent zoom or drag operation to that orientation.
The possible user interactions are documented in the Whats's This
information.
See issue #1258
The rectangle selection is no longer possible. Control+click can be used
for selecting a range of items.
This allows more freedom for performing customisations as requested in
issue "Change axis limits #838".
The "Load all data" button tool-tip and icon have been readjusted so they
hint the additional use pattern of resetting the plot to the original
zoom and range limits.
New and more appropriate icon for the "Save Plot" button. Icon from the
Silk set from famfamfam.com.
When restoring the plot state we always checked set the use-on-y-axis
checkbox when a colour was defined for a field. This is correct most of
the times because a field doesn't have a colour as long as it's not used
in the plot. However, when you uncheck a field it keeps its colour which
starts causing issues as soon these settings are reloaded.
The solution is to not only store the colour but also the check state
independently. This changes the project files format though, so the code
needs to support loading old and new file formats.
See issue #1245.
The Column Field is resized to the content.
The dummy column has been removed and the header no longer stretches the
last section property.
The table has alternating row colors for easy following of the field
checks.
The user is now able of selecting a range of contiguous points in any of
the graphs of the plot, through rectangle selection or click in single
point. This selection triggers automatically the selection of the
corresponding lines in the browsed table. In this way the user can analyse
the plot in detail.
Two other minor improvements: spelling error fixed and the dummy column in
the plot selection table has now transparent foreground (intends to avoid
wondering of the user about what functionality provides this column).
In the plot code use the blockSignals() method instead of connecting and
disconnecting signals and slots every time. The disconnects didn't
really work using the new C++11 connection code, so this commit restored
the functionality as it was intended.
This means that *a ton* of calls to updatePlot() are eliminated which
improves the performance.
It also avoid messing up the graph selection table in the Plot Dock in
certain cases.
See issue #950.
Rename the settings accessor functions from Settings::getSettingsValue()
(and similar) to Settings::getValue() (and similar). The 'Settings' bit
seems a bit redundant and costs a lot of screen space.
Use QDateTime::toMSecsSinceEpoch() instead of
deprecated QDateTime::toTime_t() which does not
correctly convert datetimes which do not exist
due to switch to Daylight Saving Time
This cleans up the main window class a bit which was getting quite large
and a bit harder to maintain than necessary.
This commit also includes two minor fixes to the plot system:
- The plot widgets are now disabled when no database file is opened.
- The progress bar shown when fetching all data is now initialised with
the correct row numbers.
Other than that this commit should in theory not change any
functionality.