This is a migrated thread and some comments may be shown as answers.

an owner-draw chart ?

3 Answers 64 Views
Chart
This is a migrated thread and some comments may be shown as answers.
scott
Top achievements
Rank 1
scott asked on 06 Sep 2010, 03:20 PM
Happy holidays to you guys... I have a user control built up around a radchart.  I want to add a completely new type of chart to this user control that requires me to draw things on a canvas.

For my prototype I simply have both canvas and RadChart in the control, then I when I want to draw it myself I show the canvas, hide the chart ... but that means I have to do my own chart title, and that means that I lose the styling, etc., that comes with the radchart.. It would be nice if I could access the RadCharts canvas directly.

Thanks -
Scott

3 Answers, 1 is accepted

Sort by
0
Vladimir Milev
Telerik team
answered on 08 Sep 2010, 07:42 AM
Hi scott,

You can try to position your canvas on top of the ChartArea control and thus draw on top of it. Bear in mind though that placing another control on top of it will screen/hide all mouse events from the chart.

All the best,
Vladimir Milev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
scott
Top achievements
Rank 1
answered on 10 Sep 2010, 01:16 PM
Hi Vlad.  Do you have an example of this ?  I just tried to track down the actual chart area + legend controls via Debug but can't find anything that gives me the dimensions such that I can use them to size + position my canvas.  Here's some debug output from a point in time after the chart has been added to LayoutRoot.Children.  All of the numbers that one expects to be interesting are 0 or NaN or Infinity...

thanks -
Scott

-       ca  {Telerik.Windows.Controls.Charting.ChartArea}   Telerik.Windows.Controls.Charting.ChartArea
-       base    {Telerik.Windows.Controls.Charting.ChartArea}   Telerik.Windows.Controls.ItemsControl {Telerik.Windows.Controls.Charting.ChartArea}
-       base    {Telerik.Windows.Controls.Charting.ChartArea}   System.Windows.Controls.ItemsControl {Telerik.Windows.Controls.Charting.ChartArea}
-       base    {Telerik.Windows.Controls.Charting.ChartArea}   System.Windows.Controls.Control {Telerik.Windows.Controls.Charting.ChartArea}
-       base    {Telerik.Windows.Controls.Charting.ChartArea}   System.Windows.FrameworkElement {Telerik.Windows.Controls.Charting.ChartArea}
+       base    {Telerik.Windows.Controls.Charting.ChartArea}   System.Windows.UIElement {Telerik.Windows.Controls.Charting.ChartArea}
        ActualHeight    0.0 double
        ActualWidth 0.0 double
        Cursor  null    System.Windows.Input.Cursor
        DataContext null    object
        FlowDirection   LeftToRight System.Windows.FlowDirection
        Height  NaN double
        HorizontalAlignment Stretch System.Windows.HorizontalAlignment
+       Language    {System.Windows.Markup.XmlLanguage} System.Windows.Markup.XmlLanguage
+       Margin  {0,0,0,0}   System.Windows.Thickness
        MaxHeight   Infinity    double
        MaxWidth    Infinity    double
        MinHeight   0.0 double
0
Vladimir Milev
Telerik team
answered on 16 Sep 2010, 08:13 AM
Hello scott,

We don't have an example of this online, however, you can retemplate the ChartArea control and place your layer inside the <ClipPanel> panel. It will size your content to be exactly aligned by the axes.

Besides that there is little that can be done to match up your drawing canvas to the plot area of the chart. We are aware of this limitation and are considering possible solutions that will let you place UIElements on screen and position them along the axes using logical axis units.

Kind regards,
Vladimir Milev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Chart
Asked by
scott
Top achievements
Rank 1
Answers by
Vladimir Milev
Telerik team
scott
Top achievements
Rank 1
Share this question
or