Telerik Forums
UI for WPF Forum
1 answer
165 views

I have a linear chart that contains data from 1/4/2019 to 31/3/2020. However, the last tick is not displayed? How to always display the last tick with the corresponding label. Thanks

 

 


<telerik:RadCartesianChart
        HorizontalZoomRangeStart="0.0" HorizontalZoomRangeEnd="1.0" RenderTransformOrigin="0.5,0.5">

        <telerik:RadCartesianChart.Resources>

            <Style BasedOn="{StaticResource LineSeriesStyle}" TargetType="{x:Type telerik:LineSeries}">
                <Setter Property="CategoryBinding" Value="X" />
                <Setter Property="ValueBinding" Value="Y" />
                <Setter Property="StrokeThickness" Value="2" />
                <Setter Property="Stroke" Value="#0083A9" /> <!-- Aon blue. See: https://brandmatters.aon.com/bms/damui/index.cfm?category=1450&assetID=4993 -->
            </Style>

        </telerik:RadCartesianChart.Resources>

        <telerik:RadCartesianChart.HorizontalAxis>
            <telerik:DateTimeContinuousAxis LabelFormat="{Binding HorizontalAxisFormatString}" 
                                            SmartLabelsMode="SmartStep" />
        </telerik:RadCartesianChart.HorizontalAxis>

        <telerik:RadCartesianChart.VerticalAxis>
            <telerik:LinearAxis
                LabelFormat="{Binding VerticalAxisFormatString}"
                RangeExtendDirection="None"
                SmartLabelsMode="SmartStep" />
        </telerik:RadCartesianChart.VerticalAxis>

        <telerik:RadCartesianChart.SeriesProvider>
            <telerik:ChartSeriesProvider Source="{Binding ItemsSource}">
                <telerik:ChartSeriesProvider.SeriesDescriptors>
                    <telerik:ChartSeriesDescriptor ItemsSourcePath="Points" TypePath="SeriesType" />
                </telerik:ChartSeriesProvider.SeriesDescriptors>
            </telerik:ChartSeriesProvider>
        </telerik:RadCartesianChart.SeriesProvider>

        <telerik:RadCartesianChart.Grid>
            <telerik:CartesianChartGrid MajorLinesVisibility="XY" />
        </telerik:RadCartesianChart.Grid>

    </telerik:RadCartesianChart>

Stenly
Telerik team
 answered on 01 Feb 2022
1 answer
77 views

In my WPF application using c#, I need a count of DataPoints of a series of particular RadCartesianChart using c# (code behind). How can I achieve it?

I have used the following line:

int a = ((Telerik.Windows.Controls.ChartView.CategoricalSeries)new System.Collections.Generic.Mscorlib_CollectionDebugView<CartesianSeries>(((Telerik.Windows.Controls.RadCartesianChart)my SelectedChart).Series).Items[0]).DataPoints.Count;

But it gives the following error:

Error	CS0122	'Mscorlib_CollectionDebugView<T>' is inaccessible due to its protection level

Dinesh
Top achievements
Rank 1
Iron
 answered on 30 Nov 2021
1 answer
190 views

Hi all,

 


<telerik:RadCartesianChart Grid.Column="0">
                            <telerik:RadCartesianChart.HorizontalAxis>
                                <telerik:CategoricalAxis TickThickness="5" MajorTickInterval="1" MajorTickLength="5" Title="Conc."/>
                                
                            </telerik:RadCartesianChart.HorizontalAxis>
                            <telerik:RadCartesianChart.VerticalAxis>
                                <telerik:LinearAxis Minimum="0" LineDashArray="5, 10, 15" TickThickness="5" Title="OD"/>
                            </telerik:RadCartesianChart.VerticalAxis>

                            <telerik:RadCartesianChart.Series>
                                <telerik:PointSeries x:Name="ChartCurve" CategoryBinding="Concentration" ValueBinding="OpticalDensity">
                                    <telerik:PointSeries.PointTemplate>
                                        <DataTemplate>
                                            <Ellipse Width="10" Height="10" Fill="{StaticResource DarkGray}"/>          
                                        </DataTemplate>
                                    </telerik:PointSeries.PointTemplate>
                                </telerik:PointSeries>
                            </telerik:RadCartesianChart.Series>
                            <telerik:RadCartesianChart.Grid>
                                <telerik:CartesianChartGrid MajorLinesVisibility="XY" />
                            </telerik:RadCartesianChart.Grid>
                            <telerik:RadCartesianChart.Annotations>
                                <telerik:CartesianCustomLineAnnotation 
                                       HorizontalFrom="0.0" VerticalFrom="2.25" 
                                       HorizontalTo="20" VerticalTo="10" 
                                       Stroke="{StaticResource DarkGray}"  
                                       StrokeThickness="3" />
                            </telerik:RadCartesianChart.Annotations>
                        </telerik:RadCartesianChart>

1) I try to add a line, doesnt work with

telerik:CartesianCustomLineAnnotation

2)  change position of Title Y axis to top position,  and 3) change position of Title X axis to right.  Doesnt found the way to do it

Thanks in advance for your help

Didier

Dinko | Tech Support Engineer
Telerik team
 answered on 06 Sep 2021
Narrow your results
Selected tags
Tags
+? more
Top users last month
Mark
Top achievements
Rank 1
Yurii
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Hon
Top achievements
Rank 1
Iron
Deltaohm
Top achievements
Rank 3
Bronze
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Mark
Top achievements
Rank 1
Yurii
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Hon
Top achievements
Rank 1
Iron
Deltaohm
Top achievements
Rank 3
Bronze
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?