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

Incorrect yaxis values

1 Answer 52 Views
ChartView
This is a migrated thread and some comments may be shown as answers.
William
Top achievements
Rank 1
William asked on 15 Feb 2017, 02:57 PM

I have a simple RadCartesianChart set up with binding. What I'm seeing is what appears to be yaxis labels, but these labels aren't related to the data itself. I have no idea where these extraneous numbers are coming from.

This is the xaml:

                    <telerik:RadCartesianChart x:Name="WeibullChart3" HorizontalAlignment="Left" VerticalAlignment="Top">
                        <telerik:RadCartesianChart.HorizontalAxis>
                            <telerik:DateTimeContinuousAxis LabelFitMode="Rotate" LabelFormat="yyyy/MM/dd" LabelInterval="2"/>
                        </telerik:RadCartesianChart.HorizontalAxis>
                        <telerik:RadCartesianChart.VerticalAxis>
                            <telerik:LinearAxis ToolTip="Duane Curve" LabelFitMode="Rotate" VerticalContentAlignment="Top" HorizontalContentAlignment="Left" />
                        </telerik:RadCartesianChart.VerticalAxis>
                        <!--<telerik:RadCartesianChart.Grid>
                            <telerik:CartesianChartGrid StripLinesVisibility="None" MajorLinesVisibility="XY" BorderThickness="1,0,1,1">
                                <telerik:CartesianChartGrid.YStripeBrushes>
                                    <SolidColorBrush Color="Black" />
                                    <SolidColorBrush Color="Black" />
                                </telerik:CartesianChartGrid.YStripeBrushes>
                                <telerik:CartesianChartGrid.XStripeBrushes>
                                    <SolidColorBrush Color="Black" />
                                    <SolidColorBrush Color="Black" />
                                </telerik:CartesianChartGrid.XStripeBrushes>
                            </telerik:CartesianChartGrid>
                        </telerik:RadCartesianChart.Grid>-->
                        <telerik:RadCartesianChart.Grid>
                            <telerik:CartesianChartGrid MajorLinesVisibility="XY"/>
                        </telerik:RadCartesianChart.Grid>
                        <telerik:LineSeries x:Name="Duane1" CategoryBinding="XVal" ValueBinding="YVal" ItemsSource="{Binding Document.WeibullDuanePlot}">
                        <telerik:LineSeries.PointTemplate>
                                <DataTemplate>
                                    <Ellipse Width="2" Height="2" Fill="Black" Opacity="0" />
                                </DataTemplate>
                        </telerik:LineSeries.PointTemplate>
                        </telerik:LineSeries>
                        <telerik:LineSeries x:Name="Duane2" CategoryBinding="XVal" ValueBinding="YVal" ItemsSource="{Binding Document.WeibullAggregatePlot}">
                           <telerik:LineSeries.PointTemplate>
                                <DataTemplate>
                                    <Ellipse Width="2" Height="2" Fill="Black" Opacity="0" />
                                </DataTemplate>
                           </telerik:LineSeries.PointTemplate>
                        </telerik:LineSeries>
                        <telerik:RadCartesianChart.Behaviors>
                            <telerik:ChartPanAndZoomBehavior ZoomMode="Both" PanMode="Both"/>
                            <chartView:ChartTooltipBehavior />
                        </telerik:RadCartesianChart.Behaviors>
                    </telerik:RadCartesianChart>
                    <telerik:RadLegend Items="{Binding LegendItems, ElementName=WeibullChart3}" Height="30">
                        <telerik:RadLegend.ItemsPanel>
                            <ItemsPanelTemplate>
                                <telerik:RadWrapPanel Orientation="Horizontal" ItemWidth="120" HorizontalAlignment="Center"/>
                            </ItemsPanelTemplate>
                        </telerik:RadLegend.ItemsPanel>
                    </telerik:RadLegend>
                </StackPanel>
            </telerik:RadTabItem>

 

This is the C# code:

            (WeibullChart3.HorizontalAxis as DateTimeContinuousAxis).Maximum = maxX;
            (WeibullChart3.HorizontalAxis as DateTimeContinuousAxis).Minimum = minX;
            (WeibullChart3.HorizontalAxis as DateTimeContinuousAxis).Title = "Date";

            (WeibullChart3.VerticalAxis as LinearAxis).Maximum = maxY;
            (WeibullChart3.VerticalAxis as LinearAxis).Minimum = minY;
            //(WeibullChart3.VerticalAxis as LinearAxis).Title = type.ToString();

            Plot_Title3.Text = type.ToString() + " Duane curve";

1 Answer, 1 is accepted

Sort by
0
Martin Ivanov
Telerik team
answered on 16 Feb 2017, 09:55 AM
Hello William,

Without a runnable code I can't tell what happens. However, it seems that there is a LabelTemplate defined for the LinearAxis. Check if the template is set somewhere in code and see its text formatting.

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
William
Top achievements
Rank 1
Answers by
Martin Ivanov
Telerik team
Share this question
or