[vtk-developers] [VTK 0013865]: Legend in vtkPlotStracked shows the same color for all entries

Mantis Bug Tracker mantis at public.kitware.com
Thu Feb 7 17:31:39 EST 2013


The following issue has been SUBMITTED. 
====================================================================== 
http://vtk.org/Bug/view.php?id=13865 
====================================================================== 
Reported By:                Bastian Angermann
Assigned To:                
====================================================================== 
Project:                    VTK
Issue ID:                   13865
Category:                   (No Category)
Reproducibility:            have not tried
Severity:                   minor
Priority:                   normal
Status:                     backlog
Project:                    TBD 
Type:                       incorrect functionality 
Resolution:                 open
Fixed in Version:           
====================================================================== 
Date Submitted:             2013-02-07 17:31 EST
Last Modified:              2013-02-07 17:31 EST
====================================================================== 
Summary:                    Legend in vtkPlotStracked shows the same color for
all entries
Description: 
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;
}
====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2013-02-07 17:31 Bastian AngermannNew Issue                                    
2013-02-07 17:31 Bastian AngermannFile Added: vtkPlotStacked.png                
   
======================================================================




More information about the vtk-developers mailing list