Skip to content
Snippets Groups Projects
Commit 46331049 authored by Veith Röthlingshöfer's avatar Veith Röthlingshöfer
Browse files

Scaling makes sense, values are shown

parent 3fbfded7
No related branches found
No related tags found
1 merge request!3Barchart add-on for plotter gui-plugin
......@@ -251,16 +251,18 @@ namespace armarx
if (graphStyle != idx)
{
graphStyle = idx;
stackedLayout->setCurrentIndex(graphStyle);
switch (idx)
{
case 0: //curves
stackedLayout->setCurrentIndex(graphStyle); //to test
case 0: //curves can have various scalings
ui.BTNAutoScale->setDisabled(false);
break;
case 1: //bar chart
case 1: //bar chart only autoscale possible
stackedLayout->setCurrentIndex(graphStyle); //to test
ui.BTNAutoScale->setDisabled(true);
break;
default:
......@@ -381,36 +383,18 @@ namespace armarx
QwtSeriesData<QPointF>* pointSeries = new QwtPointSeriesData(pointList);
if (curves.find(it->first) != curves.end())
if (curves.find(it->first) != curves.end() && bars.find(it->first) != bars.end())
{
QwtPlotCurve* curve = curves[it->first];
curve->setData(pointSeries);
}
if (bars.find(it->first) != bars.end())
{
QwtThermo* bar = bars[it->first];
double value = (double) pointSeries->sample(pointSeries->size() - 1).y();
bar->setValue(value);
/* if (ui.BTNAutoScale->isChecked())
{
bar->setAutoScale();
}*/
/*if (value < 0)
{
bar->setRange(value, 0);
}
else
{
bar->setRange(0, value);
}*/
bar->setRange(0, value);
bar->setValue(pointList.first().y());
bar->setRange(1.25 * (curve->minYValue()), 1.25 * (curve->maxYValue()));
}
}
......@@ -517,6 +501,8 @@ namespace armarx
QwtThermo* ArmarXPlotter::createBar(const QString& label)
{
//creates a widget containing a bar chart and a label
//with the fill color same as in curve
QVBoxLayout* layout = new QVBoxLayout(getWidget());
QwtThermo* t = new QwtThermo(getWidget());
t->setAccessibleName(label);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment