Charts being cropped left and right, do not display properly

5 posts, 1 answers
  1. George
    George avatar
    62 posts
    Member since:
    Sep 2008

    Posted 09 Apr 2015 Link to this post

    Hi, I have a problem with charts not being displayed properly and being cropped to the left and right edges as the attached picture suggests. The code I use to construct the chart is as follows:

    this.radChart.View.Margin = new Padding(15);
    ChartTooltipController toolTipController = new ChartTooltipController();
    toolTipController.DataPointTooltipTextNeeded += toolTipController_DataPointTooltipTextNeeded;
    this.radChart.Controllers.Add(toolTipController);
    this.radChart.ShowToolTip = true;
    this.radChart.ShowPanZoom = true;
     
    LineSeries dailySeries = new LineSeries();
    dailySeries.BorderColor = Color.DarkBlue;
    dailySeries.BorderWidth = 1;
    dailySeries.PointSize = new SizeF(5, 5);
    dailySeries.ShowLabels = true;
     
    foreach (var r in (from q in DailyData orderby q.FIXING_DATE select q))
    {
        dailySeries.DataPoints.Add(new CategoricalDataPoint(r.FIXING, r.FIXING_DATE) { Label = "old" });               
    }
                 
    DateTimeCategoricalAxis categoricalAxis = new DateTimeCategoricalAxis();
    categoricalAxis.DateTimeComponent = DateTimeComponent.Date;
    categoricalAxis.MajorTickInterval = 21;
    categoricalAxis.PlotMode = AxisPlotMode.OnTicks;
    categoricalAxis.LabelFitMode = AxisLabelFitMode.MultiLine;
    categoricalAxis.LabelFormat = "{0:MMM-yy}";
     
    CartesianArea area = this.radChart.GetArea<CartesianArea>();
    area.ShowGrid = true;
    CartesianGrid grid = area.GetGrid<CartesianGrid>();
    grid.DrawHorizontalFills = true;
    grid.BorderDashStyle = System.Drawing.Drawing2D.DashStyle.DashDot;
     
    //First assign the axis to the VerticalAxis property and then add the series to the chart
    dailySeries.HorizontalAxis = categoricalAxis;           
     
    this.radChart.Series.Add(dailySeries);
     

    Can you pleaase suggest a solution to this problem?

     

    Regards,

     

    George

  2. Answer
    Stefan
    Admin
    Stefan avatar
    2891 posts

    Posted 10 Apr 2015 Link to this post

    Hello George,

    Thank you for writing.

    The DateTimeCategoricalAxis has a functionality to clip its labels to the size of the axis and this functionality is turned on my default. To turn it off, just set the following property:
    categoricalAxis.ClipLabels = false;

    More information about this axis is available here: http://www.telerik.com/help/winforms/chartview-axes-datetime.html.

    I hope that you find this information useful. Should you have any other questions, do not hesitate to contact us.

    Regards,
    Stefan
    Telerik
     

    See What's Next in App Development. Register for TelerikNEXT.

     
  3. UI for WinForms is Visual Studio 2017 Ready
  4. George
    George avatar
    62 posts
    Member since:
    Sep 2008

    Posted 10 Apr 2015 in reply to Stefan Link to this post

    Thanks Stefan.
  5. George
    George avatar
    62 posts
    Member since:
    Sep 2008

    Posted 10 Apr 2015 in reply to George Link to this post

    Sorry for coming back, but just noticed the problem persists, althaugh it partially solves the issue.

    On one hand it solves the label problem that were being cropped, but on the chart body it has no effect. As you can see on the attached picture of my chart I have defined the last point of the lineseries to be of size 10X10, but it is being cropped from view. Can you pls propose a solution that also adreeses this issue?

     

    Regards,

     

    George

     

  6. Dimitar
    Admin
    Dimitar avatar
    1404 posts

    Posted 14 Apr 2015 Link to this post

    Hello George,

    Thank you for writing back.

    Please note that in this case the last label visibility depends on the MajorTickInterval as well. So if there are enough data points the last label will be visible. For example if you have 100 data points and if you set the MajorTickInterval to 9 the last label will be visible.

    I have logged this case in our Feedback Portal and our developers will take a look at it and determine if this can be improved. You can track the item for status changes and add your vote for it here.

    Your Telerik Points have been updated for this report.

    Should you have any other questions do not hesitate to ask.

     
    Regards,
    Dimitar
    Telerik
     

    See What's Next in App Development. Register for TelerikNEXT.

     
Back to Top
UI for WinForms is Visual Studio 2017 Ready