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 1145

Summary: Long strings in the legend
Product: .NET TeeChart Reporter: yeray alonso <yeray>
Component: LegendAssignee: Steema Issue Manager <issuemanager>
Status: RESOLVED FIXED    
Severity: enhancement CC: chris
Priority: ---    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows   
Chart Series: --- Delphi / C++ Builder RAD IDE Version:

Description yeray alonso 2015-02-18 05:51:52 EST
Same as Java B1143:
http://bugs.teechart.net/show_bug.cgi?id=1143
Same as VCL:
http://bugs.teechart.net/show_bug.cgi?id=1144

When we have a very string in a series point/title to be shown in the legend, the legend isn't shown:

            Bar bar1 = new Bar(tChart1.Chart);
            bar1.FillSampleValues();
            for (int i = 0; i < bar1.Count; i++)
            {
                if (i == 2)
                    bar1.Labels[i] = "This is a really really looooooooong string for the point index " + i + ". This is so long because we want to test how the chart looks when there are long strings in the legend";
                else
                    bar1.Labels[i] = "Point Index " + i;
            }

            tChart1.Legend.Alignment = LegendAlignments.Bottom;

Adding a LegendScrollBar doesn't fix it.

We could add a MaxWidth property. If the legend can't be drawn within this MaxWidth, the strings could be cut (with "..." at the end), we could automatically add a LegendScrollBar, or we could multiline the legend.