Telerik Forums
UI for WPF Forum
3 answers
398 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
3 answers
106 views

I downloaded this zip file from my account downloads area :   
Telerik_UI_for_WPF_2015_3_1104_Demos
...and I am loading ExamplesCS_WPF.sln in VS2015 update 1. 
I assumed I could run any of the projects as I liked, but after trying a handful, each fails either at build or run time.
I did try using the WPF upgrade wizard, that didn't seem to help.  I am up to date with Telerik Control Panel.  Is there some other prerequisite?  
I found no readme or other discussion of how to build or run this demo project.

Aylin
Telerik team
 answered on 07 Jan 2016
3 answers
691 views

This post makes it sound like there is no way to change the resize cursors for diagram shapes ... is this still the case?

Martin Ivanov
Telerik team
 answered on 07 Jan 2016
1 answer
68 views
Does ChartView have support for Cyrillic font? I use Russified Windows 7 and interested in Cyrillics in captions and headers in the charts and diagrams.
 
 
 
Peshito
Telerik team
 answered on 07 Jan 2016
1 answer
129 views

Hi, when selecting items from the autocomplete box they add the items horizontally and to the right of the previous item. Is it possible to have each item have it's own row?

 

So instead of [Item1] [Item2] [Item3]

It'll be

 

[Item1]

[Item2]

[Item3]

Nasko
Telerik team
 answered on 07 Jan 2016
2 answers
355 views
Hello,

in the documentation of the RadGridView (at http://www.telerik.com/help/wpf/radgridview-performance-tips-tricks.html) I've read the following:
"DataLoadMode="Asynchronous" - using this mode is not recommended, it leads to potential problems. Please do not use it."

Can you elaborate on why it is not recommended to use this and what the "potential problems" are ?

By the way: It is a bit odd to read in the documentation that an existing Feature should not be used :-)

Thank you!

Sincerely yours,
David
Jan Heiko Houtrouw
Top achievements
Rank 1
 answered on 06 Jan 2016
2 answers
266 views

Hey,

 

I tried getting a around, creating custom template and style for the crosshair labels, however nothing gets displayed.

Could you point me in the right direction with a simple demo? E.g vertical label being a red circle with the text written in black.

 

Thanks in advance

Petr
Top achievements
Rank 1
 answered on 06 Jan 2016
3 answers
104 views
if i serialize \r\n using IValueProvider, RestoreValue will change it to \n instead (\r is missing)
Kiril Vandov
Telerik team
 answered on 06 Jan 2016
3 answers
1.3K+ views
Using 2013.Q2.SP1

I am trying to use the Drag and Drop example in my application and it uses the style below. However, when I run my application I get an error because of the BasedOn="{StaticResource GridViewRowStyle}". Where is this style? I could not find it in the VS 2012 samples. 

Error Message:
{"Cannot find resource named 'GridViewRowStyle'. Resource names are case sensitive."}

<Style TargetType="telerik:GridViewRow" x:Key="OrderItemStyle" BasedOn="{StaticResource GridViewRowStyle}">
            <Setter Property="telerik:DragDropManager.AllowCapturedDrag" Value="True" />
            <Setter Property="telerik:DragDropManager.TouchDragTrigger" Value="TapAndHold"/>
</Style>
Stefan
Telerik team
 answered on 06 Jan 2016
1 answer
756 views

Hi! First of all I bag your pardon for my poor English. I'm very interested in using ChartView control for building charts displaying information in real-time. I write a WPF C# application that is reading (in real-time) data slices (via COM-port) from ultrasonic flowmeter for gas conduit and (after reading every data slice) drawing (in real-time) line chart from data of this slice. So I have two questions:

1) Can I use ChartView for drawing of those charts in real-time?

2) What is the maximal time-resolution of ChartView? Does it has time-resolution in microseconds (that is it can executes drawing of chart in time-interval of tens of fmicroseconds) or in milliseconds only?

 
 
 
 
 
 
 
 
 
Petar Marchev
Telerik team
 answered on 06 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
Expander
Slider
TileList
PersistenceFramework
DataPager
Styling
TimeBar
OutlookBar
TransitionControl
FileDialogs
Book
ToolBar
ColorPicker
TimePicker
MultiColumnComboBox
SyntaxEditor
VirtualGrid
Wizard
ExpressionEditor
NavigationView (Hamburger Menu)
WatermarkTextBox
DesktopAlert
BarCode
SpellChecker
DataServiceDataSource
EntityFrameworkDataSource
RadialMenu
ChartView3D
Data Virtualization
BreadCrumb
LayoutControl
ProgressBar
Sparkline
TabbedWindow
ToolTip
CloudUpload
ColorEditor
TreeMap and PivotMap
EntityFrameworkCoreDataSource (.Net Core)
HeatMap
Chat (Conversational UI)
VirtualizingWrapPanel
Calculator
NotifyIcon
TaskBoard
TimeSpanPicker
BulletGraph
Licensing
WebCam
CardView
DataBar
FilePathPicker
PasswordBox
SplashScreen
Callout
Rating
Accessibility
CollectionNavigator
Localization
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?