This is a migrated thread and some comments may be shown as answers.

StepLine and Marking Annotation Issue

1 Answer 70 Views
ChartView
This is a migrated thread and some comments may be shown as answers.
Sivakumar
Top achievements
Rank 1
Sivakumar asked on 20 Dec 2016, 10:18 AM
Hi Telerik,
  
We are facing two issues when we are using Stepline series.
  
ISSUE 1 :
  
When there is only one category / data point then chart is not drawing . We have such cases  and we need solution or workaround for this case
          
        <telerik:StepLineSeries>
            <telerik:StepLineSeries.DataPoints>
                <telerik:CategoricalDataPoint Category="1" Value="1.0" />
                <!--<telerik:CategoricalDataPoint Category="2" Value=1.1" />
                <telerik:CategoricalDataPoint Category="3" Value="1.0" />
                <telerik:CategoricalDataPoint Category="4" Value="1.1" />-->
            </telerik:StepLineSeries.DataPoints>
        </telerik:StepLineSeries>
ISSUE 2 :
We are using marked zone but marking falling in between and not from beginning so we used margin workaround from telerik to fix (Please see code from attached xaml.cs file)
  
Before Shifting
See image
 
After Shifting
See image
 
    BELOW CODE USED TO ALIGN MARGIN
int categoriesCount = this.horizontalAxis.Categories.Count();
double categorySlotSize = this.chart.PlotAreaClip.Width *    this.chart.Zoom.Width / categoriesCount;
  
                var margin = new Thickness(-(categorySlotSize / 2), 0, 0, 0);
                if (!margin.ToString().Contains("Infinity"))
                {
                    this.chart.Annotations.Where(x => x is CartesianMarkedZoneAnnotation).ToList()
                        .ForEach(m => { m.Margin = margin; });
  
                }
But we are facing issue when we zoom the chart.The marking going out of actual area.Please help to resolve it.
      
After Zooming 
See Image
          
ISSUE 3 :
  
When we are using marking for last category then the marking done for half way only.Please help to draw until end (Need to support while zooming as well)
  
            <telerik:StepLineSeries>
            <telerik:StepLineSeries.DataPoints>
                <telerik:CategoricalDataPoint Category="1" Value="1.0" />
                <telerik:CategoricalDataPoint Category="2" Value="1.1" />
                <telerik:CategoricalDataPoint Category="3" Value="1.0" />
                <telerik:CategoricalDataPoint Category="4" Value="1.1" />
            </telerik:StepLineSeries.DataPoints>
        </telerik:StepLineSeries>
  
<telerik:CartesianMarkedZoneAnnotation VerticalFrom="1.0" VerticalTo="1.1" HorizontalFrom="4" Fill="Red"/>

1 Answer, 1 is accepted

Sort by
0
Martin Ivanov
Telerik team
answered on 22 Dec 2016, 10:10 AM
Hi Sivakumar,

I already answered your question in this forum. I would ask you to keep the communication for a specific topic in a single thread.

Regards,
Martin
Telerik by Progress
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
Tags
ChartView
Asked by
Sivakumar
Top achievements
Rank 1
Answers by
Martin Ivanov
Telerik team
Share this question
or