Unplanned
Last Updated: 06 Feb 2017 11:33 by ADMIN
ADMIN
Dess | Tech Support Engineer, Principal
Created on: 06 Jan 2017 10:23
Category: ChartView
Type: Bug Report
1
FIX. RadChartView - VerticalAdjusmentLabelsStrategy doesn't arrange the labels correctly when a second Right vertical axis is added
To reproduce:

public RadForm1()
{
    InitializeComponent();
    Random rand = new Random(); 
    
    LineSeries lineSeria = new LineSeries();
    lineSeria.ValueMember = "WorkingHours";
    lineSeria.CategoryMember = "Date";
    lineSeria.ShowLabels = true;
    lineSeria.PointSize = new System.Drawing.SizeF(10, 10);
    lineSeria.BackColor = Color.Red;
    LinearAxis verticalAxis2 = new LinearAxis();
    verticalAxis2.AxisType = AxisType.Second;
    verticalAxis2.HorizontalLocation = AxisHorizontalLocation.Right ;
    lineSeria.VerticalAxis = verticalAxis2;
    DataTable table = new DataTable();
    table.Columns.Add("Value", typeof(double));
    table.Columns.Add("Name", typeof(string));
    table.Rows.Add(rand.Next(1, 20), "John");
    table.Rows.Add(rand.Next(1, 20), "Adam");
    table.Rows.Add(rand.Next(1, 20), "Peter");
    table.Rows.Add(rand.Next(1, 20), "Sam");
    table.Rows.Add(rand.Next(1, 20), "Paul");
    lineSeria.ValueMember = "Value";
    lineSeria.CategoryMember = "Name";
    lineSeria.DataSource = table;

    BarSeries barSeria = new BarSeries();
   
    barSeria.ValueMember = "Finished";
    barSeria.CategoryMember = "Date";
    barSeria.ShowLabels = true;
    barSeria.BackColor = Color.Aqua;
    LinearAxis verticalAxis1 = new LinearAxis();
    verticalAxis1.AxisType = AxisType.Second;
    verticalAxis1.HorizontalLocation = AxisHorizontalLocation.Left;
    barSeria.VerticalAxis = verticalAxis1;

    table = new DataTable();
    table.Columns.Add("Value", typeof(double));
    table.Columns.Add("Name", typeof(string));
    table.Rows.Add(rand.Next(1, 20), "John");
    table.Rows.Add(rand.Next(1, 20), "Adam");
    table.Rows.Add(rand.Next(1, 20), "Peter");
    table.Rows.Add(rand.Next(1, 20), "Sam");
    table.Rows.Add(rand.Next(1, 20), "Paul");
    barSeria.ValueMember = "Value";
    barSeria.CategoryMember = "Name";
    barSeria.DataSource = table;

    this.radChartView1.ChartElement.View.Series.Add(lineSeria);
    this.radChartView1.ChartElement.View.Series.Add(barSeria);
    this.radChartView1.ChartElement.Margin = new System.Windows.Forms.Padding(10);
    (this.radChartView1.ChartElement.View.Axes[0] as CategoricalAxis).LabelFitMode =
        Telerik.Charting.AxisLabelFitMode.MultiLine; 
     
    SmartLabelsController c = new SmartLabelsController();

    this.radChartView1.ChartElement.View.Controllers.Add(c);
}

Workaround: change the strategy: 
SmartLabelsController c = new SmartLabelsController();
c.Strategy = new FourPositionsLabelsStrategy();
this.radChartView1.ChartElement.View.Controllers.Add(c);
Attached Files:
0 comments