Steema Issues Database

Note: This database is for bugs and wishes only. For technical support help, if you are a customer please visit our online forums;
otherwise you can use StackOverflow.
Before using this bug-tracker we recommend a look at this document, Steema Bug Fixing Policy.



Bug 934

Summary: Area series Legend symbol not following point color
Product: .NET TeeChart Reporter: christopher ireland <chris>
Component: SeriesAssignee: Steema Issue Manager <issuemanager>
Status: RESOLVED FIXED    
Severity: normal    
Priority: ---    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows   
Chart Series: --- Delphi / C++ Builder RAD IDE Version:
Bug Depends on:    
Bug Blocks: 1060    

Description christopher ireland 2014-09-25 03:57:51 EDT
Problem can be seen in the following code:

    private void InitializeChart()
    {
      tChart1.Aspect.View3D = false;

      Area area = new Area(tChart1.Chart);

      area.Add(1, 5, Color.Red);
      area.Add(2, 1, Color.Blue);
      area.Add(3, 4, Color.Yellow);
      area.Add(4, 2, Color.Green);

      area.Stairs = true;
    }

Workaround is to override PrepareLegendCanvas, where the problem lies, e.g.

  public class MyArea : Area
  {
    public MyArea(Chart c) : base(c) { }

    protected override void PrepareLegendCanvas(Graphics3D g, int valueIndex, ref Color backColor, ref ChartBrush aBrush)
    {
    }
  }