Telerik Forums
UI for WPF Forum
1 answer
204 views

Hi

I am using a RadCartesianChart with a LineSeries and would like the line to be dotted between missing values (null) instead of a gap. How can I do this?

 Regards, Lukas

Ivan
Telerik team
 answered on 11 Jan 2016
6 answers
129 views
I'm using RadScheduleView in a WPF MVVM application. The AppointmentsSource property is bound to an observable collection ObservableCollection in the ViewModel. So I have all appointments in thew view model.
How can I easily calculate if there is an ongoing appointment at the current moment ? How can I calculate when is the next appointment ?
Nasko
Telerik team
 answered on 11 Jan 2016
1 answer
85 views

I am using drilldownchart(RadChart Hierarichal Chart). I would like to use different colors for bars. I am getting same gradient color for all bars. Please find the current working chart screenshot and expected. 

 

Can we use pallette to show different colors in drill down chart. If so please provide details and some sample project.

 Please find my XAML code here 

<Window x:Class="DrillDownHierarchicalView.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
Title="MainWindow"
Height="350"
Width="525">
<Grid>
<telerik:RadChart x:Name="radChart">
<telerik:RadChart.HierarchicalViewDescriptors>
<telerik:ChartHierarchicalViewDescriptor>
<telerik:ChartHierarchicalViewDescriptor.SeriesMappings>
<telerik:SeriesMapping>
<telerik:ItemMapping FieldName="Sales.TotalAmount"
DataPointMember="YValue" />
<telerik:ItemMapping FieldName="Name"
DataPointMember="XCategory" />
</telerik:SeriesMapping>
</telerik:ChartHierarchicalViewDescriptor.SeriesMappings>
</telerik:ChartHierarchicalViewDescriptor>
<telerik:ChartHierarchicalViewDescriptor>
<telerik:ChartHierarchicalViewDescriptor.Relation>
<telerik:PropertyRelation ParentPropertyName="Sales" />
</telerik:ChartHierarchicalViewDescriptor.Relation>
<telerik:ChartHierarchicalViewDescriptor.SeriesMappings>
<telerik:SeriesMapping>
<telerik:SeriesMapping.GroupingSettings>
<telerik:GroupingSettings ShouldFlattenSeries="True">
<telerik:ChartGroupDescriptor Member="Model" />
</telerik:GroupingSettings>
</telerik:SeriesMapping.GroupingSettings>
<telerik:ItemMapping FieldName="Amount"
DataPointMember="YValue"
AggregateFunction="Sum" />
<telerik:ItemMapping FieldName="Model"
DataPointMember="XCategory" />
</telerik:SeriesMapping>
</telerik:ChartHierarchicalViewDescriptor.SeriesMappings>
</telerik:ChartHierarchicalViewDescriptor>
</telerik:RadChart.HierarchicalViewDescriptors>
</telerik:RadChart>
</Grid>
</Window>

Dinko | Tech Support Engineer
Telerik team
 answered on 11 Jan 2016
3 answers
378 views

Hi,

I have a RadCartesian Chart which has X& Y Axis as Linear axes. Chart Series is dynamically loaded. At one point my Axis labels overlap. I saw this link 

http://docs.telerik.com/devtools/wpf/controls/radchartview/axes/axis-smart-labels but I am not able find the property SmartLabelsMode in the xaml. 

Please help me solve the overlapping issue.

Here is my Xaml

  <Grid>
 
        <telerik:RadCartesianChart x:Name="CartesianChart" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"
                                   Style="{StaticResource RadCartesianChartStyle1}">
            <telerik:RadCartesianChart.Grid>
                <telerik:CartesianChartGrid MajorLinesVisibility="XY" MajorXLineStyle="{StaticResource GridLineStyle}"
                                            MajorYLineStyle="{StaticResource GridLineStyle}" />
            </telerik:RadCartesianChart.Grid>
            <telerik:RadCartesianChart.HorizontalAxis>
                <telerik:LinearAxis Title="{Binding HorizontalAxisTitle}" Minimum="{Binding Xmin}"  LineThickness="2" LineStroke="Transparent" Foreground="{DynamicResource BRUSH_TEXT}"
                                    Style="{StaticResource LinearAxisStyle}" />
                 
            </telerik:RadCartesianChart.HorizontalAxis>
            <telerik:RadCartesianChart.VerticalAxis>
                <telerik:LinearAxis Title="{Binding VerticalAxisTitle}" LineThickness="2" Foreground="{DynamicResource BRUSH_TEXT}"
                                    Style="{StaticResource LinearAxisStyle}" />
            </telerik:RadCartesianChart.VerticalAxis>
            <telerik:RadCartesianChart.SmartLabelsStrategy>
                <telerik:ChartSmartLabelsStrategy  />
            </telerik:RadCartesianChart.SmartLabelsStrategy>
 
            <telerik:RadCartesianChart.Behaviors>
                <telerik:ChartPanAndZoomBehavior DragMode="Pan" ZoomMode="Both" PanMode="Both" />
                <telerik:ChartTooltipBehavior />
            </telerik:RadCartesianChart.Behaviors>
            <telerik:RadCartesianChart.EmptyContentTemplate>
                <DataTemplate>
                    <StackPanel>
                        <TextBlock Text="{Binding EmptyContentText}" />
                    </StackPanel>
                </DataTemplate>
            </telerik:RadCartesianChart.EmptyContentTemplate>
            <telerik:RadCartesianChart.TooltipTemplate>
                <DataTemplate>
                    <Border Background="{DynamicResource BRUSH_TOOLTIP}" BorderBrush="{DynamicResource BRUSH_TOOLTIP}" BorderThickness="1" Padding="10">
                        <StackPanel Background="{DynamicResource BRUSH_TOOLTIP}">
                            <StackPanel Width="{TemplateBinding Width}" Orientation="Horizontal" Background="{DynamicResource BRUSH_TOOLTIP}" Margin="5">
                                <TextBlock Text="{Binding DataItem.VerticalAxisTitle}" />
                                <TextBlock Text="{Binding YValue}" />
                            </StackPanel>
                            <StackPanel Width="{TemplateBinding Width}" Orientation="Horizontal" Background="{DynamicResource BRUSH_TOOLTIP}" Margin="5">
                                <TextBlock Text="{Binding DataItem.HorizontalAxisTitle}" />
                                <TextBlock Text="{Binding XValue}" />
                            </StackPanel>
                            <TextBlock Text="{Binding Presenter.DisplayName}" />
                        </StackPanel>
                    </Border>
                </DataTemplate>
            </telerik:RadCartesianChart.TooltipTemplate>
            <telerik:RadCartesianChart.SeriesProvider>
                <telerik:ChartSeriesProvider x:Name="ChartSeriesProvider" Source="{Binding SeriesCollection}">
 
                    <telerik:ChartSeriesProvider.SeriesDescriptors>
 
                        <telerik:ScatterSeriesDescriptor ItemsSourcePath="Points" YValuePath="YValue" XValuePath="XValue">
                            <telerik:ScatterSeriesDescriptor.Style>
                                <Style TargetType="telerik:ScatterSplineSeries">
                                    <Setter Property="StrokeThickness" Value="{Binding StrokeThickness}" />
                                    <Setter Property="Stroke" Value="{Binding Color}" />
                                    <Setter Property="Visibility" Value="{Binding IsVisible,Converter={StaticResource BooleanToVisibilityConverter}}" />
                                    <Setter Property="DisplayName" Value="{Binding Name}" />
                                    <Setter Property="PointTemplate" Value="{StaticResource PointTemplate}" />
 
                                    <Style.Triggers>
                                        <DataTrigger Binding="{Binding IsDashed,Mode=TwoWay}" Value="True">
                                            <Setter Property="DashArray" Value="5"/>
                                        </DataTrigger>
                                    </Style.Triggers>
                                </Style>
                            </telerik:ScatterSeriesDescriptor.Style>
                        </telerik:ScatterSeriesDescriptor>
                    </telerik:ChartSeriesProvider.SeriesDescriptors>
                </telerik:ChartSeriesProvider>
            </telerik:RadCartesianChart.SeriesProvider>
        </telerik:RadCartesianChart>
    </Grid>
</UserControl>

Milena
Telerik team
 answered on 11 Jan 2016
1 answer
152 views

Hi! I bag your pardon for my poor English. Suppose I have a line chart of electronic pulse curve that has been drawn in RadCartesianChart of RadChartView. Does RadChartView support layouting (zooming) of this pulse curve using mouse wheel? In other words, when the user rotates the mouse wheel then the chart changes its size in X and Y directions of course if I define MouseWheel event handler for RadCartesianChart. So I have two questions:

1) Does RadCartesianChart of RadChartView support MouseWheel event handler for layouting (zooming) of chart in X and Y directions with change of scale on X axis and Y axis respectively?

2) Does RadCartesianChart of RadChartView support MouseMove event handler for panning (moving) of chart in X and Y directions with recalculation of values of ticks on X and Y axes respectively?

 
 
 
 
 
 
 
 
 
 
 
 
 
 
Petar Marchev
Telerik team
 answered on 11 Jan 2016
2 answers
233 views

I am using ChartView inside ItemsControl. Everything is working fine.I am facing issue when using mouse-wheel scroll for chart zoom . Issue is itemscontrol scrolling triggered instead of scroll for chart zooming even though my mouse focus on chart.

My Expected Requirement:

1.) Do Chart Zoom In/Out  When Mouse focus on chartcontrol.

2.) Do Item control scrolling when mouse focus on itemscontrol scrollbar.

  

I tried few options but those failed.Please help on this..

 

 Please see attach as well...

 

Sivakumar
Top achievements
Rank 1
 answered on 11 Jan 2016
2 answers
141 views

My Requirement to move Datapoint selection using keyboards right,left arrow keys.I am already highlight datapoints using selection changed event.But How to navigate the point? 

Please see attached... 

 

Martin Ivanov
Telerik team
 answered on 08 Jan 2016
2 answers
68 views

I call EditItem(), make my changes and then call CommitEdit().  Although the documentation says "That's it - the RadGridView will show the updated data immediately.", that doesn't seem to work for me.  The change only appears when I enter edit mode in the grid by double-clicking the cell.

I've created a small project to demonstrate my issue.

<Window x:Class="RadGridViewUpdate.MainWindow"
                xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
                Title="MainWindow" Height="350" Width="525">
   <StackPanel>
      <telerik:RadGridView x:Name="grid" />
      <Button Content="Change" Click="OnChange" />
   </StackPanel>
</Window>
 

public partial class MainWindow : Window
{
   public class Test
   {
      public string first { get; set; }
      public string second { get; set; }
      public string third { get; set; }
   }
 
   Test entry1 = new Test() { first = "1", second = "2", third = "3" };
   Test entry2 = new Test() { first = "1", second = "2", third = "3" };
 
   public MainWindow()
   {
      InitializeComponent();
      grid.Items.Add(entry1);
      grid.Items.Add(entry2);
   }
 
   private void OnChange(object sender, RoutedEventArgs e)
   {
      grid.Items.EditItem(entry1);
      entry1.second = "5";
      grid.Items.CommitEdit();
   }
}

When I click "Change", nothing is changed in the grid until I double-click the second column of the first row.

Note that this is just an example.  In my full application, I use MVVM and did try to "RaisePropertyChange".

 

 

Pierre
Top achievements
Rank 1
 answered on 08 Jan 2016
2 answers
81 views

Hey,

I am trying to deselect appointments from my viewmodel. I have tried setting the property that is bound to the selected value equal to null but that doesn't seem to work. Do you have any suggestions?

Thanks

 NA

Nick
Top achievements
Rank 1
 answered on 08 Jan 2016
3 answers
378 views

Hi,

I am using a tooltip template in Rad Cartesian Chart View for ScatterSplineSeries. I defined Point Template and tooltip template and able to display X & Y Values. I want to Display the Horizontal Axis Title along with X value and Vertical Axis Title with Y Value. Also I would like to display the spline name too. Somehow I am not able to display the contents. I read in telreik about DataItem property of DataPoint class and even tried using it but unsuccessful .Here is my XAML and View Model.

<telerik:RadCartesianChart x:Name="CartesianChart" Visibility="Visible" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"
                                  Style="{StaticResource RadCartesianChartStyle1}">
           <telerik:RadCartesianChart.Grid>
               <telerik:CartesianChartGrid MajorLinesVisibility="XY" MajorXLineStyle="{StaticResource GridLineStyle}"
                                           MajorYLineStyle="{StaticResource GridLineStyle}" />
           </telerik:RadCartesianChart.Grid>
           <telerik:RadCartesianChart.HorizontalAxis>
               <telerik:LinearAxis Title="{Binding HorizontalAxisTitle}" Minimum="0" Maximum="35" LineThickness="2" LineStroke="Transparent"
                                   Foreground="{DynamicResource BRUSH_TEXT}" Style="{StaticResource LinearAxisStyle}" />
           </telerik:RadCartesianChart.HorizontalAxis>
           <telerik:RadCartesianChart.VerticalAxis>
               <telerik:LinearAxis Minimum="0" Maximum="120" Title="{Binding VerticalAxisTitle}" LineThickness="2" Foreground="{DynamicResource BRUSH_TEXT}"
                                   Style="{StaticResource LinearAxisStyle}" />
           </telerik:RadCartesianChart.VerticalAxis>
 
           <telerik:RadCartesianChart.Behaviors>
               <telerik:ChartPanAndZoomBehavior DragMode="Pan" ZoomMode="Both" PanMode="Both" />
               <telerik:ChartTooltipBehavior />
           </telerik:RadCartesianChart.Behaviors>
 
 
           <telerik:RadCartesianChart.SeriesProvider>
               <telerik:ChartSeriesProvider x:Name="ChartSeriesProvider" Source="{Binding SplineCollection}">
 
                   <telerik:ChartSeriesProvider.SeriesDescriptors>
 
                       <telerik:ScatterSeriesDescriptor ItemsSourcePath="Points" YValuePath="YValue" XValuePath="XValue">
                           <telerik:ScatterSeriesDescriptor.Style>
                               <Style TargetType="telerik:ScatterSplineSeries">
                                   <Setter Property="StrokeThickness" Value="{Binding StrokeThickness}" />
                                   <Setter Property="Stroke" Value="{Binding Color}" />
                                   <Setter Property="TooltipTemplate">
                                       <Setter.Value>
                                           <DataTemplate>
                                               <Border Background="{DynamicResource BRUSH_TOOLTIP}" BorderBrush="{DynamicResource BRUSH_TOOLTIP}"
                                                       BorderThickness="1" Padding="10">
                                                   <StackPanel Background="{DynamicResource BRUSH_TOOLTIP}">
                                                       <StackPanel Width="{TemplateBinding Width}" Orientation="Horizontal"
                                                                   Background="{DynamicResource BRUSH_TOOLTIP}" Margin="5">
                                                           <TextBlock Text="{Binding DataItem.VerticalAxisTitle}" />
                                                           <TextBlock Text="{Binding YValue}" />
                                                       </StackPanel>
                                                       <StackPanel Width="{TemplateBinding Width}" Orientation="Horizontal"
                                                                   Background="{DynamicResource BRUSH_TOOLTIP}" Margin="5">
                                                           <TextBlock Text="{Binding DataItem.HorizontalAxisTitle}" />
                                                           <TextBlock Text="{Binding XValue}" />
                                                       </StackPanel>
                                                       <TextBlock Text="{Binding DataItem.Name}" />
                                                   </StackPanel>
                                               </Border>
                                           </DataTemplate>
                                       </Setter.Value>
                                   </Setter>
                                   <Setter Property="PointTemplate">
                                       <Setter.Value>
                                           <DataTemplate>
                                               <Ellipse Width="20" Height="20" Fill="{DynamicResource BRUSH_SELECTION}" />
                                           </DataTemplate>
                                       </Setter.Value>
                                   </Setter>
                                   <Style.Triggers>
                                       <DataTrigger Binding="{Binding IsDashed}" Value="True">
                                           <Setter Property="DashArray" Value="5" />
                                       </DataTrigger>
                                   </Style.Triggers>
                               </Style>
                           </telerik:ScatterSeriesDescriptor.Style>
                       </telerik:ScatterSeriesDescriptor>
                   </telerik:ChartSeriesProvider.SeriesDescriptors>
               </telerik:ChartSeriesProvider>
           </telerik:RadCartesianChart.SeriesProvider>
       </telerik:RadCartesianChart>

 

ViewModels

public class MainViewModel : ViewModelBase
    {
        public string HorizontalAxisTitle { get; set; }
 
        public string VerticalAxisTitle { get; set; }
 
        public ObservableCollection<SplineSeries> SplineCollection { get; set; }
 
        public MainViewModel()
        {
            HorizontalAxisTitle = string.Format("{0}", "Grey Value");
            VerticalAxisTitle = string.Format("{0}", "Volume");
            this.SplineCollection = GetSplineCollection();
        }
 
        private ObservableCollection<SplineSeries> GetSplineCollection()
        {
            var result = new ObservableCollection<SplineSeries>
            {
                new SplineSeries()
                {
                    Color = new SolidColorBrush(Colors.Red),
                    StrokeThickness = 2,
                    Name = "Structure1",
                    Points = new ObservableCollection<Data>()
                    {
                        new Data() {XValue = 0, YValue = 100},
                        new Data() {XValue = 5, YValue = 100},
                        new Data() {XValue = 9, YValue = 90},
                        new Data() {XValue = 10, YValue = 50},
                        new Data() {XValue = 20, YValue = 80},
                        new Data() {XValue = 25, YValue = 60},
                        new Data() {XValue = 30, YValue = 0}
                    }
                },
                new SplineSeries()
                {
                    Color = new SolidColorBrush(Colors.Orange),
                    IsDashed = true,
                    StrokeThickness = 2,
                    Name = "Structure2",
                    Points = new ObservableCollection<Data>()
                    {
                        new Data() {XValue = 0, YValue = 100},
                        new Data() {XValue = 5, YValue = 100},
                        new Data() {XValue = 10, YValue = 50},
                        new Data() {XValue = 20, YValue = 0}
                    }
                }
            };
            return result;
        }

 
public class SplineSeries : ViewModelBase
    {
        private SolidColorBrush myBrush = new SolidColorBrush( Colors.OrangeRed );
        public SolidColorBrush Color
        {
            get { return myBrush; }
            set { myBrush = value; }
        }
        public string  Name { get; set; }
        public double StrokeThickness { get; set; }
 
        public bool IsDashed { get; set; }
 
        public ObservableCollection<Data> Points { get; set; }
    }

 

public class Data:ViewModelBase
   {
       public double XValue { get; set; }
       public double YValue { get; set; }
   }

How do I acheive this. Kindly Help me

Shilpa
Top achievements
Rank 1
 answered on 08 Jan 2016
Narrow your results
Selected tags
Tags
GridView
General Discussions
Chart
RichTextBox
Docking
ScheduleView
ChartView
TreeView
Diagram
Map
ComboBox
TreeListView
Window
RibbonView and RibbonWindow
PropertyGrid
DragAndDrop
TabControl
TileView
Carousel
DataForm
PDFViewer
MaskedInput (Numeric, DateTime, Text, Currency)
AutoCompleteBox
DatePicker
Buttons
ListBox
GanttView
PivotGrid
Spreadsheet
Gauges
NumericUpDown
PanelBar
DateTimePicker
DataFilter
Menu
ContextMenu
TimeLine
Calendar
Installer and Visual Studio Extensions
ImageEditor
BusyIndicator
Slider
Expander
TileList
PersistenceFramework
DataPager
Styling
TimeBar
OutlookBar
TransitionControl
Book
FileDialogs
ToolBar
ColorPicker
TimePicker
SyntaxEditor
MultiColumnComboBox
VirtualGrid
Wizard
ExpressionEditor
NavigationView (Hamburger Menu)
DesktopAlert
WatermarkTextBox
BarCode
SpellChecker
DataServiceDataSource
EntityFrameworkDataSource
RadialMenu
ChartView3D
Data Virtualization
BreadCrumb
ProgressBar
Sparkline
LayoutControl
TabbedWindow
ToolTip
CloudUpload
ColorEditor
TreeMap and PivotMap
EntityFrameworkCoreDataSource (.Net Core)
HeatMap
Chat (Conversational UI)
VirtualizingWrapPanel
Calculator
NotifyIcon
TaskBoard
TimeSpanPicker
BulletGraph
WebCam
CardView
DataBar
Licensing
FilePathPicker
PasswordBox
Rating
SplashScreen
Accessibility
Callout
CollectionNavigator
Localization
AutoSuggestBox
HighlightTextBlock
Security
TouchManager
StepProgressBar
VirtualKeyboard
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?