User Chart refresh on filter changes

.. quite a few of the standard signals are ignored. this one fixes
   up refresh when the home filters are changed.
This commit is contained in:
Mark Liversedge
2020-07-25 09:12:50 +01:00
parent f01ed7c77c
commit c52a861a9a
3 changed files with 9 additions and 1 deletions

View File

@@ -529,6 +529,10 @@ GenericPlot::addCurve(QString name, QVector<double> xseries, QVector<double> yse
QLineSeries *add = new QLineSeries();
add->setName(name);
// get setup for click thru
connect(add, SIGNAL(clicked(QPointF)), selector, SLOT(seriesClicked())); // catch series clicks
filenames.insert(add, fseries);
// aesthetics
add->setBrush(Qt::NoBrush);
QPen pen(color);

View File

@@ -414,7 +414,7 @@ GenericSelectTool::clicked(QPointF pos)
bool updatescene = false;
// click on a point to click-thru
if (hoverpoint.index != -1) { // hovering and clicked
if (hoverpoint.index != -1) { // scatter plot
emit seriesClicked(hoverseries, hoverpoint);
// not sure need to do this....

View File

@@ -54,6 +54,8 @@ UserChart::UserChart(Context *context, bool rangemode) : GcChartWindow(context),
connect(this, SIGNAL(rideItemChanged(RideItem*)), this, SLOT(setRide(RideItem*)));
} else {
connect(this, SIGNAL(dateRangeChanged(DateRange)), SLOT(setDateRange(DateRange)));
connect(context, SIGNAL(homeFilterChanged()), this, SLOT(refresh()));
connect(context, SIGNAL(filterChanged()), this, SLOT(refresh()));
}
// need to refresh when chart settings change
@@ -139,6 +141,8 @@ UserChart::setRide(RideItem *item)
void
UserChart::refresh()
{
if (!amVisible()) { stale=true; return; }
// ok, we've run out of excuses, looks like we need to plot
chart->initialiseChart(chartinfo.title, chartinfo.type, chartinfo.animate, chartinfo.legendpos, chartinfo.stack, chartinfo.orientation);