Completed
Last Updated: 21 Oct 2013 09:29 by ADMIN
ADMIN
Stefan
Created on: 21 Oct 2013 09:29
Category: ChartView
Type: Bug Report
0
FIX. RadChartView - the right border of the chart grid is drawn outside the chart bounds
Use the code below and reduce the Form size to see the extra line:

  public Form1()
        {
            InitializeComponent();

            radChartView1.Parent = this;
            radChartView1.Dock = DockStyle.Fill;
            radChartView1.ShowLegend = true;

            radChartView1.ShowGrid = true;
            CartesianGrid grid = ((CartesianGrid)radChartView1.GetArea<CartesianArea>().Grid);
            grid.DrawVerticalFills = true;
            grid.AlternatingHorizontalColor = false;
            grid.AlternatingVerticalColor = false;
            grid.BackColor = Color.Red;
            grid.ForeColor = Color.Blue;
            grid.BorderDashStyle = System.Drawing.Drawing2D.DashStyle.Solid;

            DateTimeContinuousAxis horizontalAxis = new DateTimeContinuousAxis();
            horizontalAxis.MajorStepUnit = Telerik.Charting.TimeInterval.Day;
            horizontalAxis.MajorStep =2;
            horizontalAxis.LabelFormat = "{0:dd/MM/yyyy}";
            LinearAxis verticalAxis1 = new LinearAxis();
            verticalAxis1.AxisType = AxisType.Second;
            LinearAxis verticalAxis2 = new LinearAxis();
            verticalAxis2.AxisType = AxisType.Second;
            verticalAxis2.HorizontalLocation = AxisHorizontalLocation.Right;

            LineSeries line1 = new LineSeries();
            line1.HorizontalAxis = horizontalAxis;
            line1.VerticalAxis = verticalAxis1;

            LineSeries line2 = new LineSeries();
            line2.HorizontalAxis = horizontalAxis;
            line2.VerticalAxis = verticalAxis2;

            line1.DataPoints.Add(new CategoricalDataPoint(26d, DateTime.Now.AddDays(-6)));
            line1.DataPoints.Add(new CategoricalDataPoint(20d, DateTime.Now.AddDays(-5)));
            line1.DataPoints.Add(new CategoricalDataPoint(12d, DateTime.Now.AddDays(-4)));
            line1.DataPoints.Add(new CategoricalDataPoint(15d, DateTime.Now.AddDays(-2)));
            line1.DataPoints.Add(new CategoricalDataPoint(21d, DateTime.Now.AddDays(-1)));

            line2.DataPoints.Add(new CategoricalDataPoint(32d, DateTime.Now.AddDays(-6)));
            line2.DataPoints.Add(new CategoricalDataPoint(52d, DateTime.Now.AddDays(-4)));
            line2.DataPoints.Add(new CategoricalDataPoint(35d, DateTime.Now.AddDays(-3)));
            line2.DataPoints.Add(new CategoricalDataPoint(36d, DateTime.Now.AddDays(-2)));
            line2.DataPoints.Add(new CategoricalDataPoint(11d, DateTime.Now.AddDays(-1)));

            line1.LegendTitle = "line1";
            line2.LegendTitle = "line2";

            this.radChartView1.Series.Add(line1);
            this.radChartView1.Series.Add(line2);
        }
0 comments