or
at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal)
at System.Windows.FrameworkElement.set_Height(Double value)
at Telerik.Windows.Controls.ChartView.PresenterBase.ArrangeUIElement(FrameworkElement presenter, RadRect layoutSlot, Boolean setSize) in c:\TB\102\WPF_Scrum\Release_WPF\Sources\Development\Controls\Chart\Visualization\Common\PresenterBase.cs:line 297
at Telerik.Windows.Controls.ChartView.CartesianChartGrid.UpdateYStripes() in c:\TB\102\WPF_Scrum\Release_WPF\Sources\Development\Controls\Chart\Visualization\CartesianChart\CartesianChartGrid.cs:line 479
at Telerik.Windows.Controls.ChartView.CartesianChartGrid.UpdateVisuals(ChartLayoutContext context) in c:\TB\102\WPF_Scrum\Release_WPF\Sources\Development\Controls\Chart\Visualization\CartesianChart\CartesianChartGrid.cs:line 421
at Telerik.Windows.Controls.ChartView.CartesianChartGrid.UpdateUICore(ChartLayoutContext context) in c:\TB\102\WPF_Scrum\Release_WPF\Sources\Development\Controls\Chart\Visualization\CartesianChart\CartesianChartGrid.cs:line 296
<
Window
x:Class
=
"TinyChart.MainWindow"
xmlns:telerik
=
"http://schemas.telerik.com/2008/xaml/presentation"
Title
=
"MainWindow"
Height
=
"350"
Width
=
"525"
>
<
Grid
>
<
Grid.RowDefinitions
>
<
RowDefinition
Height
=
"*"
/>
</
Grid.RowDefinitions
>
<
telerik:RadCartesianChart
x:Name
=
"chart"
telerik:StyleManager.Theme
=
"Metro"
>
<
telerik:RadCartesianChart.TrackBallInfoStyle
>
<
Style
TargetType
=
"telerik:TrackBallInfoControl"
>
<
Setter
Property
=
"HeaderTemplate"
>
<
Setter.Value
>
<
DataTemplate
>
<
TextBlock
Text
=
"{Binding}"
Foreground
=
"Black"
HorizontalAlignment
=
"Center"
/>
</
DataTemplate
>
</
Setter.Value
>
</
Setter
>
</
Style
>
</
telerik:RadCartesianChart.TrackBallInfoStyle
>
<
telerik:RadCartesianChart.Behaviors
>
<
telerik:ChartTrackBallBehavior
ShowIntersectionPoints
=
"True"
ShowTrackInfo
=
"True"
SnapMode
=
"AllClosePoints"
/>
</
telerik:RadCartesianChart.Behaviors
>
<
telerik:RadCartesianChart.HorizontalAxis
>
<
telerik:DateTimeCategoricalAxis
LabelFormat
=
"dd MMM yyyy"
Title
=
"Date Processed"
DateTimeComponent
=
"DayOfYear"
LabelFitMode
=
"Rotate"
LabelInterval
=
"3"
LastLabelVisibility
=
"Visible"
>
<
telerik:DateTimeCategoricalAxis.LabelTemplate
>
<
DataTemplate
>
<
StackPanel
Orientation
=
"Horizontal"
>
<
TextBlock
Text
=
"{Binding}"
HorizontalAlignment
=
"Center"
/>
</
StackPanel
>
</
DataTemplate
>
</
telerik:DateTimeCategoricalAxis.LabelTemplate
>
</
telerik:DateTimeCategoricalAxis
>
</
telerik:RadCartesianChart.HorizontalAxis
>
<
telerik:RadCartesianChart.VerticalAxis
>
<
telerik:LinearAxis
Title
=
"# Documents Processed"
/>
</
telerik:RadCartesianChart.VerticalAxis
>
<
telerik:RadCartesianChart.Grid
>
<
telerik:CartesianChartGrid
MajorLinesVisibility
=
"Y"
StripLinesVisibility
=
"Y"
/>
</
telerik:RadCartesianChart.Grid
>
</
telerik:RadCartesianChart
>
<
Button
Command
=
"{Binding MyCommand}"
Width
=
"64"
Height
=
"64"
VerticalAlignment
=
"Top"
HorizontalAlignment
=
"Right"
Content
=
"..."
/>
</
Grid
>
</
Window
>
public class MainWindowViewModel
{
public ObservableCollection<
Item
> Items { get; set; }
public ICommand MyCommand { get; set; }
public MainWindow View { get; set; }
public MainWindowViewModel()
{
MyCommand = new RelayCommand(OnMyCommand);
Items = new ObservableCollection<
Item
>();
Items.Add(new Item { Date = DateTime.Now, Number = 1 });
Items.Add(new Item { Date = DateTime.Now.AddDays(1), Number = 0 });
Items.Add(new Item { Date = DateTime.Now.AddDays(2), Number = 0 });
Items.Add(new Item { Date = DateTime.Now.AddDays(3), Number = 0 });
Items.Add(new Item { Date = DateTime.Now.AddDays(4), Number = 0 });
Items.Add(new Item { Date = DateTime.Now.AddDays(5), Number = 0 });
Items.Add(new Item { Date = DateTime.Now.AddDays(6), Number = 0 });
Items.Add(new Item { Date = DateTime.Now.AddDays(1), Number = 1 });
Items.Add(new Item { Date = DateTime.Now.AddDays(7), Number = 0 });
}
private void OnMyCommand()
{
View.chart.Height = 100;
View.chart.Series.Add(new BarSeries
{
//StrokeThickness = 4,
//Stroke = Brushes.Red,
ItemsSource = Items,
CategoryBinding = new PropertyNameDataPointBinding("Date"),
ValueBinding = new PropertyNameDataPointBinding("Number"),
ShowLabels = false
});
}
}
public class Item
{
public DateTime Date { get; set; }
public int Number { get; set; }
public override string ToString()
{
return Date.ToString() + " - " + Number.ToString();
}
}
xmlns:chart="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Chart"
xmlns:charting="clr-namespace:Telerik.Charting;assembly=Telerik.Windows.Controls.Chart"
xmlns:chartView="clr-namespace:Telerik.Windows.Controls.ChartView;assembly=Telerik.Windows.Controls.Chart"
<
ContentControl
Grid.Row
=
"1"
HorizontalAlignment
=
"Stretch"
VerticalAlignment
=
"Stretch"
Height
=
"300"
x:Name
=
"chartPlaceHolder"
>
<
chart:RadCartesianChart
x:Name
=
"speedometerChart"
>
<
chart:RadCartesianChart.HorizontalAxis
>
<
chart:LinearAxis
/>
</
chart:RadCartesianChart.HorizontalAxis
>
<
chart:RadCartesianChart.VerticalAxis
>
<
chart:CategoricalAxis
/>
</
chart:RadCartesianChart.VerticalAxis
>
</
chart:RadCartesianChart
>
</
ContentControl
>
var appointments = new ObservableCollection<Appointment>();
Appointment myAppointment =
new
Appointment();
myAppointment.Subject =
"Appointment Here"
;
myAppointment.Start =
new
DateTime(2012, 7, 31, 00, 00, 00);
myAppointment.End =
new
DateTime(2012, 7, 31, 2, 00, 00);
appointments.Add(myAppointment);scheduleView.AppointmentsSource = appointments;