Unplanned
Last Updated: 29 Mar 2016 10:42 by ADMIN
ADMIN
Dess | Tech Support Engineer, Principal
Created on: 12 May 2015 08:49
Category: ChartView
Type: Bug Report
1
FIX. RadChartView - legend titles are not aligned correctly.
To reproduce:

public Form1()
{
    InitializeComponent();

    Random rand = new Random();
    for (int i = 0; i < 3; i++)
    {
        LineSeries lineSeries = new LineSeries();    
        lineSeries.DataPoints.Add(new CategoricalDataPoint(rand.Next(-50, 50), "Jan"));
        lineSeries.DataPoints.Add(new CategoricalDataPoint(rand.Next(-50, 50), "Apr"));
        lineSeries.DataPoints.Add(new CategoricalDataPoint(rand.Next(-50, 50), "Jul"));
        lineSeries.DataPoints.Add(new CategoricalDataPoint(rand.Next(-50, 50), "Oct"));
        this.radChartView1.Series.Add(lineSeries);
    }

    this.radChartView1.ShowLegend = true;
    this.radChartView1.ChartElement.LegendPosition = LegendPosition.Bottom;

    ((LineSeries)this.radChartView1.Series[0]).LegendTitle = "S&P 500";
    ((LineSeries)this.radChartView1.Series[1]).LegendTitle = "MSCI Emerging Markets TR Index";
    ((LineSeries)this.radChartView1.Series[2]).LegendTitle = "Great ETF";
}


Workaround:

Font f = new Font("Times New Roman", 10f, FontStyle.Regular);

private void Form1_Load(object sender, EventArgs e)
{
    foreach (LegendItemElement item in this.radChartView1.ChartElement.LegendElement.StackElement.Children)
    {
        item.Font = f;
    }
}
Attached Files:
0 comments