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 1098 - Legends with many items not behaving correctly when being resized or when horizontally aligned
Summary: Legends with many items not behaving correctly when being resized or when hor...
Status: RESOLVED NOTABUG
Alias: None
Product: .NET TeeChart
Classification: Unclassified
Component: Legend (show other bugs)
Version: unspecified
Hardware: PC Windows
: --- critical
Target Milestone: ---
Assignee: Steema Issue Manager
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-01-22 07:30 EST by Shantanu
Modified: 2015-01-26 08:57 EST (History)
1 user (show)

See Also:
Chart Series: ---
Delphi / C++ Builder RAD IDE Version:


Attachments
Sample example for Legend invisible Items (39.57 KB, application/x-zip-compressed)
2015-01-22 07:30 EST, Shantanu
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Shantanu 2015-01-22 07:30:30 EST
Created attachment 390 [details]
Sample example for Legend invisible Items

Hi,

If legend has many items, then the invisible items are not updating text when window resized or Legend aligned horizontally (top/bottom).

Can you look into this?

More Info:

What TeeChart version are you using? 
-- TeeChart for .NET 2012 (4.1.2012.09280)

What IDE are you using?
-- Visual Studio 2013

What language are you programming with?
-- C#

What exact OS are you running?
-- Windows 7 (32 bit)

Thanks
Shantanu
Comment 1 christopher ireland 2015-01-26 08:57:59 EST
This is an issue with the changing of the Legend text by the cursor tool. The correct way of doing this is as follows:

      tChart1.Resize += tChart1_Resize;

    private double xval;

    private void ChangeLegendText(double xValue)
    {
      if (!_isLoaded)
        return;
      xval = xValue;
      for (int i = 0; i < tChart1.Series.Count; i++)
      {
        if (tChart1.Series[i].Active)
        {
          if (tChart1.Series[i] is Steema.TeeChart.Styles.Custom)
          {
            string legendText = tChart1.Series[i].Title + ": " + InterpolateLineSeries(tChart1.Series[i] as Steema.TeeChart.Styles.Custom, xval).ToString("0.00");
            tChart1.Legend.Items[i].Text = legendText;
          }
        }
      }
    }

    void tChart1_Resize(object sender, EventArgs e)
    {
      ChangeLegendText(xval);
    }

    private void cursorTool1_Change(object sender, Steema.TeeChart.Tools.CursorChangeEventArgs e)
    {
      ChangeLegendText(e.XValue);
    }