I have a problem with Bar Chart. I have one graph, but data on it has different types and I want to distinguish them by different colors. I tried so:
for (int i = 0; i < sortedClassifierResults.size(); i++) { QColor penColor = ClassifierResultsWindow::questionTypeColor[sortedClassifierResults[i].first.type]; QColor brushColor = ClassifierResultsWindow::questionTypeColor[sortedClassifierResults[i].first.type]; questionClassifierPlotBar->setPen(QPen(penColor)); questionClassifierPlotBar->setBrush(QBrush(brushColor)); questionClassifierPlotBar->addData(ticks[i], priorities[i]); questionClassifierPlot->replot(); }
But as I supposed it didn't work. All bars have the last brush set. Is there any way to realize it or I need to create QCPBars on each type? The second way seems to me bad looking.
Thank you!