Hello everyone,
I am trying to create a bargraph with 37 bars that switches based on the input value. However I can not find a simple way of doing this. Here is my attempt loop at trying to switch colors.
for(int i=0; i < 37; i++) { if(masterData[i] < 50 && masterData[i] > 20) { mGraph->setPen(QPen(QColor(238, 244, 66).lighter(170))); mGraph->setBrush(QColor(238, 244, 66)); } if (masterData[i] < 20) { mGraph->setPen(QPen(QColor(244, 65, 65).lighter(170))); mGraph->setBrush(QColor(244, 65, 65)); } else { mGraph->setPen(QPen(QColor(73, 244, 65).lighter(170))); mGraph->setBrush(QColor(73, 244, 65)); } }
obviously this does not work as it switch all of the bars color and not the individual bar. Any ideas?