ChartView Line Chart Label position to Offset in to the left

3 posts, 0 answers
  1. Dominic
    Dominic avatar
    7 posts
    Member since:
    Oct 2017

    Posted 20 May 2020 Link to this post

    How for I offset ChartView Line Chart Label position more to the left of the datapoint ?

    Meaning how do I move the label further left of the datapoint ?


  2. Nadya
    Nadya avatar
    486 posts

    Posted 21 May 2020 Link to this post

    Hello Dominic,

    In order to achieve this, you can subscribe to the LabelFormatting event and in the handler manually move the label to the left. This can be done by setting a proper value to the PointLabelElement.PosittionOffset property. Please refer to the following example that uses LineSeries to plot the data points:

     public RadForm1()
         LineSeries lineSeries = new LineSeries();
         lineSeries.DataPoints.Add(new CategoricalDataPoint(21, "Jan"));
         lineSeries.DataPoints.Add(new CategoricalDataPoint(22, "Apr"));
         lineSeries.DataPoints.Add(new CategoricalDataPoint(12, "Jul"));
         lineSeries.DataPoints.Add(new CategoricalDataPoint(15, "Oct"));
         LineSeries lineSeries2 = new LineSeries();
         lineSeries2.DataPoints.Add(new CategoricalDataPoint(18, "Feb"));
         lineSeries2.DataPoints.Add(new CategoricalDataPoint(15, "Apr"));
         lineSeries2.DataPoints.Add(new CategoricalDataPoint(17, "Jul"));
         lineSeries2.DataPoints.Add(new CategoricalDataPoint(22, "Oct"));
         lineSeries2.DataPoints.Add(new CategoricalDataPoint(30, "Nov"));
         lineSeries.ShowLabels = true;
         lineSeries2.ShowLabels = true;
         this.radChartView1.LabelFormatting += this.RadChartView1_LabelFormatting;
     private void RadChartView1_LabelFormatting(object sender, ChartViewLabelFormattingEventArgs e)
         PointLabelElement pointLabel = e.LabelElement as PointLabelElement;
         if (pointLabel != null)
             pointLabel.PositionOffset = new PointF(-10, 0);
             pointLabel.DataPointElement.PointSize = new SizeF(10, 10);

    I hope this helps. Should you have other questions do not hesitate to ask.

    Progress Telerik

    Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
    Our thoughts here at Progress are with those affected by the outbreak.
  3. Dominic
    Dominic avatar
    7 posts
    Member since:
    Oct 2017

    Posted 31 May 2020 in reply to Nadya Link to this post

    Ok thanks for your reply :)
Back to Top