Legend in vtkPlotStracked shows the same color for all entries
This issue was created automatically from an original Mantis Issue. Further discussion may take place here.
I am drawing a vtkPlotStracked where the colors are set using a vtkColorSeries. All colors displayed in the legend are the same. The color that is displayed matches the color I would expect for the last entry (see the attached screenshot).
The code for the PaintLegend method reads bool vtkPlotStacked::PaintLegend(vtkContext2D *painter, const vtkRectf& rect, int) { painter->ApplyPen(this->Pen); painter->ApplyBrush(this->Brush); painter->DrawRect(rect[0], rect[1], rect[2], rect[3]); return true; }
shouldn't this be
bool vtkPlotStacked::PaintLegend(vtkContext2D *painter, const vtkRectf& rect, int legendIndex) { if (this->ColorSeries) { this->Brush->SetColor( this->ColorSeries->GetColorRepeating(legendIndex).GetData()); } painter->ApplyPen(this->Pen); painter->ApplyBrush(this->Brush); painter->DrawRect(rect[0], rect[1], rect[2], rect[3]); return true; }