WPF Design adding series.
Posted: Thu Nov 19, 2009 3:55 pm
Hello,
Is it possible to define the series and chart in xaml at design time when using TeeChart.WPF? We are using TeeChart.WPF.dll 4.0.2009.35592.
Using the VCL version of Tchart, it was extremely useful to see the chart with it's series being populated at design time.
When we attempt this at design time in Blend/Visual Studio using TeeChart.WPF we encounter errors.
The xaml listed below compiles correctly, but an exception is thrown when it attempts to render (in design or runtime).
Is there anything we can do to edit the chart properties/series at design time, without requiring to create the series at runtime?
The Exception information is:
Thanks!
Is it possible to define the series and chart in xaml at design time when using TeeChart.WPF? We are using TeeChart.WPF.dll 4.0.2009.35592.
Using the VCL version of Tchart, it was extremely useful to see the chart with it's series being populated at design time.
When we attempt this at design time in Blend/Visual Studio using TeeChart.WPF we encounter errors.
The xaml listed below compiles correctly, but an exception is thrown when it attempts to render (in design or runtime).
Is there anything we can do to edit the chart properties/series at design time, without requiring to create the series at runtime?
Code: Select all
<?xml version='1.0' encoding='utf-8' ?>
<Window x:Class="WindowsApplication1.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="WindowsApplication1" Height="300" Width="300"
xmlns:chart="clr-namespace:Steema.TeeChart.WPF;assembly=TeeChart.WPF"
xmlns:series="clr-namespace:Steema.TeeChart.WPF.Styles;assembly=TeeChart.WPF"
xmlns:tools="clr-namespace:Steema.TeeChart.WPF.Tools;assembly=TeeChart.WPF"
xmlns:drawing="clr-namespace:Steema.TeeChart.WPF.Drawing;assembly=TeeChart.WPF">
<Grid>
<chart:TChart x:Name="tChart1" Margin="0, 0, 0, 50" Width="700"
Height="350">
<chart:TChart.Panel>
<chart:Panel>
<chart:Panel.Gradient>
<drawing:Gradient Visible="True" StartColor="Blue"
EndColor="Red"/>
</chart:Panel.Gradient>
</chart:Panel>
</chart:TChart.Panel>
<chart:TChart.Aspect>
<drawing:Aspect View3D="False"/>
</chart:TChart.Aspect>
<chart:TChart.Series>
<series:Points Color="Green">
<series:Points.SeriesPoints>
<series:SeriesXYPoint X="50" Y="50"/>
<series:SeriesXYPoint X="150" Y="150"/>
<series:SeriesXYPoint X="260" Y="250"/>
</series:Points.SeriesPoints>
</series:Points>
</chart:TChart.Series>
<chart:TChart.Tools>
<tools:Annotation Text="Hello"/>
</chart:TChart.Tools>
</chart:TChart>
</Grid>
</Window>
Code: Select all
Object reference not set to an instance of an object.
at Steema.TeeChart.WPF.Legend.DrawSymbol(Series series, Int32 index, Rect r)
at Steema.TeeChart.WPF.Legend.DrawLegendItem(Int32 ItemIndex, Int32 ItemOrder)
at Steema.TeeChart.WPF.Legend.DrawItems()
at Steema.TeeChart.WPF.Legend.Paint(Graphics3D g, Rect rect)
at Steema.TeeChart.WPF.Chart.DoDrawLegend(Rect& tmp)
at Steema.TeeChart.WPF.Chart.DrawTitlesAndLegend(DrawingContext g, Rect& tmp, Boolean BeforeSeries)
at Steema.TeeChart.WPF.Chart.InternalDraw(DrawingContext g, Boolean noTools)
at Steema.TeeChart.WPF.TChart.Draw(DrawingContext g)
at Steema.TeeChart.WPF.TChart.OnRender(DrawingContext drawingContext)
at System.Windows.UIElement.Arrange(Rect finalRect)
at System.Windows.Controls.Grid.ArrangeOverride(Size arrangeSize)
at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect)
at System.Windows.UIElement.Arrange(Rect finalRect)
at MS.Internal.Helper.ArrangeElementWithSingleChild(UIElement element, Size arrangeSize)
at System.Windows.Controls.ContentPresenter.ArrangeOverride(Size arrangeSize)
at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect)
at System.Windows.UIElement.Arrange(Rect finalRect)
at System.Windows.Controls.Decorator.ArrangeOverride(Size arrangeSize)
at System.Windows.Documents.AdornerDecorator.ArrangeOverride(Size finalSize)
at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect)
at System.Windows.UIElement.Arrange(Rect finalRect)
at System.Windows.Controls.Grid.ArrangeOverride(Size arrangeSize)
at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect)
at System.Windows.UIElement.Arrange(Rect finalRect)
at System.Windows.Controls.Border.ArrangeOverride(Size finalSize)
at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect)
at System.Windows.UIElement.Arrange(Rect finalRect)
at System.Windows.Controls.Border.ArrangeOverride(Size finalSize)
at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect)
at System.Windows.UIElement.Arrange(Rect finalRect)
at System.Windows.Controls.DockPanel.ArrangeOverride(Size arrangeSize)
at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect)
at System.Windows.UIElement.Arrange(Rect finalRect)
at System.Windows.Controls.Border.ArrangeOverride(Size finalSize)
at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect)
at System.Windows.UIElement.Arrange(Rect finalRect)
at System.Windows.Controls.Grid.ArrangeOverride(Size arrangeSize)
at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect)
at System.Windows.UIElement.Arrange(Rect finalRect)
at System.Windows.Controls.Control.ArrangeOverride(Size arrangeBounds)
at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect)
at System.Windows.UIElement.Arrange(Rect finalRect)
at System.Windows.ContextLayoutManager.UpdateLayout()
at System.Windows.ContextLayoutManager.UpdateLayoutCallback(Object arg)
at System.Windows.Media.MediaContext.InvokeOnRenderCallback.DoWork()
at System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()
at System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget)
at System.Windows.Media.MediaContext.RenderMessageHandler(Object resizedCompositionTarget)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)