Telerik Forums
UI for WPF Forum
2 answers
266 views

How to give positive and negative values ​​set different colors.

ChartView can do it?

<chart:RadCartesianChart x:Name="chart1" Width="1725" Height="176" TrackBallLineStyle="{StaticResource trackBallLineStyle}" Grid.RowSpan="2" Loaded="chart1_Loaded">
                        <chart:RadCartesianChart.TrackBallInfoStyle>
                            <Style TargetType="chartView:TrackBallInfoControl">
                                <Setter Property="Template">
                                    <Setter.Value>
                                        <ControlTemplate TargetType="chartView:TrackBallInfoControl">
                                            <StackPanel Name="panel">
                                            </StackPanel>
                                        </ControlTemplate>
                                    </Setter.Value>
                                </Setter>
                            </Style>
                        </chart:RadCartesianChart.TrackBallInfoStyle>
                        <chart:RadCartesianChart.Behaviors>
                            <chartView:ChartTrackBallBehavior ShowIntersectionPoints="False" />
                        </chart:RadCartesianChart.Behaviors>
                        <chartView:AreaSeries CategoryBinding="Time" ValueBinding="Data"  Fill="#FFCC80"  Stroke="#FF9900" StrokeThickness="2"  ItemsSource="{Binding DemoList}" Loaded="AreaSeries_Loaded">
                            <chartView:AreaSeries.TrackBallInfoTemplate>
                                <DataTemplate>
                                    <StackPanel Orientation="Vertical" Margin="0,0,0,20">
                                        <Border Background="#666666" Width="65" Height="20" CornerRadius="3" HorizontalAlignment="Center" VerticalAlignment="Center">
                                            <TextBlock Text="{Binding DataPoint.Value}" FontSize="14" FontFamily="Segoe UI" Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                        </Border>
                                        <Path HorizontalAlignment="Center" VerticalAlignment="Center" Height="6" Width="14" Stretch="Fill" Opacity="1" Data="M 25,22 C25,22 39,22 39,22 39,22 32,28 32,28 32,28 25,22 25,22 z" Fill="#666666" Margin="0,2,0,0"/>
                                    </StackPanel>
                                </DataTemplate>
                            </chartView:AreaSeries.TrackBallInfoTemplate>
                        </chartView:AreaSeries>
                        <chart:RadCartesianChart.HorizontalAxis>
                            <chartView:DateTimeContinuousAxis MajorStepUnit="Month"
                                                          MajorStep="3"
                                                LabelFormat="yyyy年MM月dd日"
                                                LabelInterval="1" FontFamily="Segoe UI"
                                                PlotMode="OnTicks" />
                        </chart:RadCartesianChart.HorizontalAxis>
                        <chart:RadCartesianChart.VerticalAxis>
                            <chartView:LinearAxis Minimum="-3000"
                                    MajorStep="1000"
                                    Maximum="3000" FontFamily="Segoe UI" MajorTickStyle="{StaticResource tickStyle}" LabelStyle="{StaticResource yLableStyle}">
                            </chartView:LinearAxis>
                        </chart:RadCartesianChart.VerticalAxis>
                        <chart:RadCartesianChart.Grid>
                            <chartView:CartesianChartGrid MajorLinesVisibility="X" MajorXLineDashArray="7,3" StripLinesVisibility="Y">
                                <chartView:CartesianChartGrid.MajorXLineStyle>
                                    <Style TargetType="{x:Type Line}">
                                        <Setter Property="Stroke" Value="#CCCCCC"/>
                                    </Style>
                                </chartView:CartesianChartGrid.MajorXLineStyle>
                                <chartView:CartesianChartGrid.YStripeBrushes>
                                    <SolidColorBrush Color="Transparent" />
                                    <SolidColorBrush Color="#EDEDED" Opacity="0.5" />
                                </chartView:CartesianChartGrid.YStripeBrushes>
                            </chartView:CartesianChartGrid>
                        </chart:RadCartesianChart.Grid>
                    </chart:RadCartesianChart>

H
Top achievements
Rank 1
 answered on 13 Dec 2013
4 answers
310 views




I cannot get a simple RadCartesianChart to display when setting the style for a CategoricalSeriesDescriptor.  I have a simple one window WPF app (I can send the project if you wish). The project has a folder called "Blah" in which the Telerik.Windows.Controls.xaml and Telerik.Windows.Controls.Chart.xaml Windows8 resource dictionaries are located (both with build action of Page). The Telerik binaries that are referenced by the project are the latest noxaml versions.



If I remove the style for the CategoricalSeriesDescriptor.Style, the chart shows as expected. If I add the style, the project will build and run, but, the chart will not draw, and the message "No data to plot" is displayed. The output shows no exceptions. 



Also, when I edit the XAML, no errors are displayed in the XAML editor in VS. However, as soon as I build, the XAML editor underlines (in blue) the entire CategoricalSeriesDescriptor element. The tooltip error message for that element is 'The value "Telerik.Windows.Controls.ChartView.CategoricalSeriesDescriptor" is not of type "Telerik.WIndows.Controls.ChartView.ChartSeriesDescriptor" and cannot be used in this generic collection. Parameter name: value'



Further, if I remove the style completely, the XAML editor complains about the properties like ItemsSourcePath and TypePath. But without the style, the project runs and the chart is displayed. 



Please help me figure out what I'm doing wrong.  Is it something to do with the resource dictionaries & usage of the noxaml assemblies?  The rest of the code is basically straight out of the examples & it's driving me crazy :(.



Thanks - Mitch



The XAML for the windows is:

<Window x:Class="Chart3.MainWindow"
        Title="MainWindow" Height="350" Width="525">
 
    <Window.Resources>
 
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="pack://application:,,,/Chart3;component/Blah/Telerik.Windows.Controls.xaml"/>
                <ResourceDictionary Source="pack://application:,,,/Chart3;component/Blah/Telerik.Windows.Controls.Chart.xaml"/>
            </ResourceDictionary.MergedDictionaries>
 
        </ResourceDictionary>
    </Window.Resources>
 
    <Grid>
        <telerik:RadCartesianChart x:Name="chart">
            <telerik:RadCartesianChart.HorizontalAxis>
                <telerik:DateTimeCategoricalAxis/>
            </telerik:RadCartesianChart.HorizontalAxis>
 
            <telerik:RadCartesianChart.VerticalAxis>
                <telerik:LinearAxis/>
            </telerik:RadCartesianChart.VerticalAxis>
 
            <telerik:RadCartesianChart.SeriesProvider>
                <telerik:ChartSeriesProvider
                    Source="{Binding Series}">
 
                    <telerik:ChartSeriesProvider.SeriesDescriptors>
 
                        <telerik:CategoricalSeriesDescriptor ItemsSourcePath="MyData"
                            CategoryPath="Category"
                            ValuePath="Value"
                            TypePath = "SeriesType">
 
                            
                            <telerik:CategoricalSeriesDescriptor.Style>
                                <Style TargetType="{x:Type telerik:LineSeries}">
                                    <Setter Property="StrokeThickness" Value="8"/>
                                </Style>
                            </telerik:CategoricalSeriesDescriptor.Style>
                             
                        </telerik:CategoricalSeriesDescriptor>
                    </telerik:ChartSeriesProvider.SeriesDescriptors>
 
                </telerik:ChartSeriesProvider>
            </telerik:RadCartesianChart.SeriesProvider>
 
 
        </telerik:RadCartesianChart>
    </Grid>
</Window>


and the code behind that populates the data, etc. is:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Collections.ObjectModel;
using Telerik.Charting;
using Telerik.Windows.Controls.ChartView;
 
namespace Chart3
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
            this.DataContext = this;
 
            this.Series = new ObservableCollection<ChartSeries>();
             
            //add some data.
            ChartSeries series = new ChartSeries();
 
            MyPoint dp = new MyPoint();
            dp.Value = 10;
            dp.Category = DateTime.Now;
            series.MyData.Add(dp);
 
            dp = new MyPoint();
            dp.Value = 40;
            dp.Category = DateTime.Now.AddMonths(2);
            series.MyData.Add(dp);
 
            dp = new MyPoint();
            dp.Value = 20;
            dp.Category = DateTime.Now.AddMonths(3);
            series.MyData.Add(dp);
 
            this.Series.Add(series);
        }
 
        public ObservableCollection<ChartSeries> Series
        {
            get;
            set;
        }
    }
 
    public class ChartSeries
    {
        public ChartSeries()
        {
            this.MyData = new ObservableCollection<MyPoint>();
            this.SeriesType = typeof(LineSeries);
        }
 
        public Type SeriesType { get; set; }
 
        public ObservableCollection<MyPoint> MyData
        { get; set; }
    }
 
    public class MyPoint
    {
        public object Category { get; set; }
        public double? Value { get; set; }
    }
}


Mitchell
Top achievements
Rank 1
 answered on 12 Dec 2013
4 answers
1.0K+ views
Is it possible to put a dropshadow effect around the RadWindow that pops up?
Dennis
Top achievements
Rank 1
 answered on 12 Dec 2013
1 answer
89 views
Hello, on a WPF desktop application, is there a way to completely customize how to display the box that represents a day on the month view of a calendar?  For example, instead of just relying upon a scheduler-view to show my appointments throughout a day, I want to have some symbols, colors and patterns display within the month-view of the calendar itself to indicate the appointments. I want to tinker with it - using graphics, colors, perhaps even some animation if necessary.  Does the calendar control provide this ability?

I am also going to tart other platforms including Win8, mobile, and web. But the WPF desktop (on Windows 7 or Windows 8 in desktop-mode) is what I'm concentrating on at the moment.

Thank you for your help & advice,

James Hurst

Windows 7 x64 Professional
Microsoft Visual Studio Ult. 2013
Konstantina
Telerik team
 answered on 12 Dec 2013
7 answers
320 views
Hi,
I am trying to print the entire contents in RadGrid which is having Parent and Child Grid. But on printing, the header shows additional row as "Drag a column header and drop it here to group by that column" which is not visible on screen but displayed in printing.

Kindle suggest how to hide the additional row.

Regards,
Vinetha.P
Dimitrina
Telerik team
 answered on 12 Dec 2013
1 answer
125 views
Hi,
   I have a gridview with a column bound with DataMemberBinding and the content is string.
In the string, this is when a carriage return, the row height changes.
I want to keep it fixed, how can you do?

Thanks,

Alberto
Top achievements
Rank 1
 answered on 12 Dec 2013
1 answer
1.3K+ views
Hi, I'd like to remove the mouse over row style completely, or at least change it be a lot more subtle. I've experimented with overriding the Background colour on mouseover as below:

<telerik:RadGridView.RowStyle>
    <Style TargetType="telerik:GridViewRow">
 
        <Style.Triggers>
            <Trigger Property="IsMouseOver" Value="True">
                <Setter Property="Background" Value="Transparent" />
            </Trigger>
        </Style.Triggers>
 
    </Style>
</telerik:RadGridView.RowStyle>

But this doesn't remove the style, there seems to be some sort of glass effect still that I can't change. I'm using the "Transparent" theme.

Basically I just don't want to row to change much or at all when the mouse is over.

thanks
Yoan
Telerik team
 answered on 12 Dec 2013
7 answers
799 views
Hello

I really appreciate the Rad Grid View filtering and grouping possibilities, but I have such case that I need to filter the source collection before it goes to your control. So I need in fact two filters, first I filter in code the collection and then I filter this filtered collection by your Rad Grid View.

So simply I have my ObservableCollection which is bounded to the Rad Grid View ItemsSource property. Then I am getting the collection view  by the CollectionViewSource.GetDefaultView() method and I am applying there my custom filter to the Filter property.

The problem is that the Rad Grid View seems to not react on that change. So my question is do you support such approach? What else can I do to filter my item before I can filter them by the control UI?

Thank you for help.

My Rad Grid View XAML:

<telerikControls:RadGridView
        HorizontalAlignment="Stretch"
        ItemsSource="{Binding myCollection}"
        SelectedItem="{Binding mySelectedItem, Mode=OneWayToSource}"
        IsReadOnly="True"
        CanUserFreezeColumns="False"
        AutoGenerateColumns="False"
        RowIndicatorVisibility="Collapsed">
BF1468901
Top achievements
Rank 1
 answered on 12 Dec 2013
2 answers
158 views


Hello Telerik,

So.. i have a RadDateTimePicker to which i want to apply Windows8TouchTheme and i want to change the content of Close Button.

To accomplish this, i've generated the style in Blend, i've searched the CloseButtonContainer and i've changed the content of Close Button and everything works perfectly.
But now, if i want to apply the theme, this is not being applied. It doesn't metter where i'm trying to apply.
This is my RadDateTimePicker:

<telerik:RadDateTimePicker DateTimeWatermarkContent="Select a date"
                           StartTime="00:00"
                           EndTime="23:59"
                           TimeInterval="1:00"
                           Style="{StaticResource ResourceKey=RadDateTimePickerStyle}"  >
</telerik:RadDateTimePicker>

And this is my style: 

<Style x:Key="RadDateTimePickerStyle"
              TargetType="{x:Type telerik:RadDateTimePicker}">
      <Setter Property="telerik:StyleManager.Theme"
              Value="Windows8Touch" />
      <Setter Property="Margin"
              Value="5" />......


And i've tried to apply the theme like this too:

<telerik:RadDateTimePicker  DateTimeWatermarkContent="Select a date"
           StartTime="00:00"
           EndTime="23:59"
           TimeInterval="1:00"
           Style="{StaticResource ResourceKey=RadDateTimePickerStyle}"
           telerik:StyleManager.Theme="Windows8Touch" >
</telerik:RadDateTimePicker>


So.. please .. please help me!! 
Thank you in advance!




Roxana
Top achievements
Rank 1
 answered on 12 Dec 2013
1 answer
166 views
Hello,
        
        We are developing application where we need dynamic series addition to the same radcartesian chart. We are able to add more than one series(may be of different or same) dynamically to single chart. It works fine.But we have got one problem related to the area series and same in case of spline area series.

Problem :-
        
             when we add more than one area /spline area series to the chart, the small area series gets overlapped by larger one and there is no way to know whether small area series is present or not unless we move the cursor to legends.

I am attaching 2 images for demonstrating the problem.In image1.png ,you can see that there are 2 area series one is in Green color(which is small) and other is in Blue color(which has more area than Green color area series). In this image we can see green color area series because on mouse hover on legendes,the corresponding series gets highlighted.But in Imag2.png, we can,t see green color area series.

Is there any way to draw the small area series over the bigger area series or something related to this.? so that we can see the both area series.

Thank You in Advance
Petar Marchev
Telerik team
 answered on 12 Dec 2013
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
ProgressBar
Sparkline
LayoutControl
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
Rating
SplashScreen
Accessibility
Callout
CollectionNavigator
Localization
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Top achievements
Rank 1
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ivory
Top achievements
Rank 1
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
YF
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Top achievements
Rank 1
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ivory
Top achievements
Rank 1
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
YF
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?