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

Bubble chart - visual glitch

3 Answers 65 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Trude
Top achievements
Rank 2
Trude asked on 08 Jul 2010, 01:01 AM
Please see the attached image. Bubble chart to the left and line to the right. The bubble chart has an offset from the y-axis to the zero value on the x-axis and it looks out of place. Here's the XAML:
<telerik:RadChart x:Name="Bubble" Width="160" Height="160" VerticalAlignment="Center" Margin="20,0,0,0" Visibility="Collapsed">  
    <telerik:RadChart.SeriesMappings> 
        <telerik:SeriesMapping> 
            <telerik:SeriesMapping.SeriesDefinition> 
                <telerik:LineSeriesDefinition/> 
            </telerik:SeriesMapping.SeriesDefinition> 
            <telerik:SeriesMapping.ItemMappings> 
                <telerik:ItemMapping DataPointMember="XValue" FieldName="value_0.value"/>  
                <telerik:ItemMapping DataPointMember="YValue" FieldName="value_1.value"/>  
            </telerik:SeriesMapping.ItemMappings> 
        </telerik:SeriesMapping> 
    </telerik:RadChart.SeriesMappings> 
</telerik:RadChart> 

Code behind:
        Bubble.DefaultView.ChartArea.AxisX.AutoRange = False 
        Bubble.DefaultView.ChartArea.AxisX.MaxValue = 6  
        Bubble.DefaultView.ChartArea.AxisX.MinValue = 0  
        Bubble.DefaultView.ChartArea.AxisX.AddRange(0, 6, 1)  
        Bubble.DefaultView.ChartArea.AxisX.MajorGridLinesVisibility = Visibility.Visible  
        Bubble.DefaultView.ChartArea.AxisY.AutoRange = False 
        Bubble.DefaultView.ChartArea.AxisY.MaxValue = 6  
        Bubble.DefaultView.ChartArea.AxisY.MinValue = 0  
        Bubble.DefaultView.ChartArea.AxisY.AddRange(0, 6, 1)  
        Bubble.DefaultView.ChartArea.AxisY.StripLinesVisibility = Visibility.Collapsed  
        Bubble.DefaultView.ChartArea.AxisY.MinorTicksVisibility = Visibility.Collapsed  
        Bubble.DefaultView.ChartArea.AxisY.MajorGridLinesVisibility = Visibility.Visible  
        Bubble.DefaultView.ChartArea.PlotAreaStyle = LayoutRoot.Resources("ClipPanelStyle")  
        Bubble.DefaultView.ChartArea.Legend.Visibility = Visibility.Collapsed  
        Bubble.DefaultView.ChartArea.EnableAnimations = False 
        Bubble.DefaultView.ChartArea.EnableStripLinesAnimation = False 
        Bubble.Background = Nothing 
        Bubble.ItemsSource = ds_chart 

Also is there a way to only show axis title and hide all values and ticklines (major and minor)??? I can't figure it out.

3 Answers, 1 is accepted

Sort by
0
Accepted
Sia
Telerik team
answered on 13 Jul 2010, 11:30 AM
Hello Jorn,

Have you tried settiing the LayoutMode property for your RadChart? You can find more information about it in our help section.

Regarding your second question, you need to have the following resources:
xmlns:charting="clr-namespace:Telerik.Windows.Controls.Charting;assembly=Telerik.Windows.Controls.Charting">
<UserControl.Resources>
    <Style x:Key="CustomAxisX" TargetType="charting:AxisX2D" >
        <Setter Property="AxisLabelsVisibility" Value="Collapsed" />
        <Setter Property="AxisTicksVisibility" Value="Collapsed" />
    </Style>
    <Style x:Key="CustomAxisY" TargetType="charting:AxisY2D" >
        <Setter Property="AxisLabelsVisibility" Value="Collapsed" />
        <Setter Property="AxisTicksVisibility" Value="Collapsed" />
    </Style>
</UserControl.Resources>

and set them in your code-behind:
//Hides the MinorTicks
RadChart1.DefaultView.ChartArea.AxisY.MinorTicksVisibility = Visibility.Collapsed;
 
//Hides the GridLines and the StripLines which are visible by default
RadChart1.DefaultView.ChartArea.AxisY.MajorGridLinesVisibility = Visibility.Collapsed;
RadChart1.DefaultView.ChartArea.AxisY.StripLinesVisibility = Visibility.Collapsed;
 
//Hides the Labels and the MajorTicks
RadChart1.DefaultView.ChartArea.AxisXStyle = this.Resources["CustomAxisX"] as Style;
RadChart1.DefaultView.ChartArea.AxisYStyle = this.Resources["CustomAxisY"] as Style;
 
//Titles
RadChart1.DefaultView.ChartArea.AxisX.Title = "AxisX Title";
RadChart1.DefaultView.ChartArea.AxisY.Title = "AxisY Title";

where RadChart1 is the name of the RadChart ( in your case it is Bubble).

Regards,
Sia
the Telerik team
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 Public Issue Tracking system and vote to affect the priority of the items
0
Trude
Top achievements
Rank 2
answered on 18 Aug 2010, 12:20 PM
Telerik should consider making it easier to hide/show certain basic elements on a chart, like ShowValues, ShowTicks (True/False) etc.

Anyway, thanks for the workaround regarding my second question. I will also check out the layoutmode documentation.

0
Sia
Telerik team
answered on 18 Aug 2010, 02:24 PM
Hi Jorn,

We have it in mind and such API will be introduced in the near future.

Best wishes,
Sia
the Telerik team
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 Public Issue Tracking system and vote to affect the priority of the items
Tags
Chart
Asked by
Trude
Top achievements
Rank 2
Answers by
Sia
Telerik team
Trude
Top achievements
Rank 2
Share this question
or