mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-05-25 06:58:23 -05:00
Bar charts did not display labels in x axis when NULL values present
The problem was signaled by an error when calling addTicks: [...]AddTicks[...] passed unequal length vectors for positions and labels See comment in issue #2286
This commit is contained in:
+10
-5
@@ -360,11 +360,16 @@ void PlotDock::updatePlot(SqliteTableModel* model, BrowseDataTableSettings* sett
|
||||
{
|
||||
tdata[j] = j;
|
||||
|
||||
// NULL values produce gaps in the graph. We use NaN values in
|
||||
// that case as required by QCustomPlot.
|
||||
if(x != RowNumId && model->data(model->index(j, x), Qt::EditRole).isNull())
|
||||
xdata[j] = qQNaN();
|
||||
else {
|
||||
if(x != RowNumId && model->data(model->index(j, x), Qt::EditRole).isNull()) {
|
||||
// NULL values produce gaps in the linear graphs. We use NaN values in
|
||||
// that case as required by QCustomPlot.
|
||||
// Bar plots will display the configured string for NULL values.
|
||||
if(xtype == QVariant::String) {
|
||||
xdata[j] = j+1;
|
||||
labels << model->data(model->index(j, x), Qt::DisplayRole).toString();
|
||||
} else
|
||||
xdata[j] = qQNaN();
|
||||
} else {
|
||||
|
||||
// convert x type axis if it's datetime
|
||||
switch (xtype) {
|
||||
|
||||
Reference in New Issue
Block a user