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

Ho to hide the horizontal line but keep the lable

1 Answer 140 Views
Chart
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Mostafa
Top achievements
Rank 1
Mostafa asked on 01 Aug 2016, 12:45 PM

Hello,

I have a bar series with some data, I have updated the horizontal axis, I want to show the label but hide the horizontal line.

here is the code 

<telerik:RadCartesianChart VerticalAlignment="Stretch"    PaletteName="DefaultLight" >
                                <telerik:RadCartesianChart.HorizontalAxis>
                                    <telerik:CategoricalAxis x:Name="XAxis" TickThickness="0"  BorderThickness="0" GapLength="0.4"   FontWeight="SemiBold">
                                        <telerik:CategoricalAxis.LabelTemplate>
                                            <DataTemplate>
                                                <Ellipse Width="5" Height="5" Fill="#999999" HorizontalAlignment="Center" />
                                            </DataTemplate>
                                        </telerik:CategoricalAxis.LabelTemplate>
                                    </telerik:CategoricalAxis>
                                </telerik:RadCartesianChart.HorizontalAxis>

                                <telerik:RadCartesianChart.VerticalAxis>
                                    <telerik:LinearAxis x:Name="YAxis" Visibility="Collapsed" Minimum="0.1" Maximum="{Binding YAxisMaxmimum}"  BorderBrush="Transparent"/>

                                </telerik:RadCartesianChart.VerticalAxis>

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

                                <telerik:RadCartesianChart.Behaviors>
                                    <telerik:ChartSelectionBehavior DataPointSelectionMode="Single" SelectionChanged="ChartSelectionBehavior_SelectionChanged" />
                                </telerik:RadCartesianChart.Behaviors>

                                <telerik:BarSeries  CombineMode="Stack" AllowSelect="True" ItemsSource="{Binding Mytems}">
                                    <telerik:BarSeries.PointTemplates>
                                        <DataTemplate>
                                            <Border  Background="Transparent"  BorderThickness="2"/>
                                        </DataTemplate>
                                    </telerik:BarSeries.PointTemplates>
                                    <telerik:BarSeries.ValueBinding >
                                        <telerik:PropertyNameDataPointBinding PropertyName="Prop1" />
                                    </telerik:BarSeries.ValueBinding>
                                    <telerik:BarSeries.CategoryBinding>
                                        <telerik:PropertyNameDataPointBinding PropertyName="CustomedDate" />
                                    </telerik:BarSeries.CategoryBinding>
                                </telerik:BarSeries>

                                <telerik:BarSeries  CombineMode="Stack" AllowSelect="True" ItemsSource="{Binding Mytems}">
                                    <telerik:BarSeries.PointTemplates>
                                        <DataTemplate>
                                            <Border  Background="#ffffff"  BorderThickness="2"/>
                                        </DataTemplate>
                                    </telerik:BarSeries.PointTemplates>
                                    <telerik:BarSeries.ValueBinding >
                                        <telerik:PropertyNameDataPointBinding PropertyName="RemainingCostHeight" />
                                    </telerik:BarSeries.ValueBinding>
                                    <telerik:BarSeries.CategoryBinding>
                                        <telerik:PropertyNameDataPointBinding PropertyName="CustomedDate" />
                                    </telerik:BarSeries.CategoryBinding>
                                </telerik:BarSeries>


                            </telerik:RadCartesianChart>

 

How can I do this?

 

Thanks,

1 Answer, 1 is accepted

Sort by
0
Accepted
Pavel R. Pavlov
Telerik team
answered on 04 Aug 2016, 08:01 AM
Hello,

You cannot hide the line of the axis out of the box. However, you can make it transparent. Please try the following style and let us know if you need any further assistance.

<telerikChart:CategoricalAxis x:Name="XAxis" TickThickness="0"  BorderThickness="0" GapLength="0.4"   FontWeight="SemiBold" >
                    <telerikChart:CategoricalAxis.LineStyle>
                        <Style TargetType="Line">
                            <Setter Property="Stroke" Value="Transparent"/>
                        </Style>
                    </telerikChart:CategoricalAxis.LineStyle>
                    <telerikChart:CategoricalAxis.LabelTemplate>
                        <DataTemplate>
                            <StackPanel>
                                <Ellipse Width="5" Height="5" Fill="#999999" HorizontalAlignment="Center" />
                            </StackPanel>
                        </DataTemplate>
                    </telerikChart:CategoricalAxis.LabelTemplate>
                </telerikChart:CategoricalAxis>
            </telerikChart:RadCartesianChart.HorizontalAxis>
I hope this will help you out.

Regards,
Pavel R. Pavlov
Telerik by Progress
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Chart
Asked by
Mostafa
Top achievements
Rank 1
Answers by
Pavel R. Pavlov
Telerik team
Share this question
or