Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6341103
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T19:57:52+00:00 2026-05-24T19:57:52+00:00

Hi i have 4 chart controls in a canvas. when i click a chart

  • 0

Hi i have 4 chart controls in a canvas. when i click a chart control it should zoom relative to the control position. its zoomin perfectly but it is going out side of the canvas.

code

 <Canvas x:Name="SampleCanvas" Background="#F5F7F9" Height="530"    Width="1010">
                    <chartingToolkit:Chart  x:Name="mcChart" Loaded="mcChart_Loaded"  Width="400" Height="250" Canvas.Left="5" Canvas.Top="5" MouseLeftButtonDown="brdMovable_MouseLeftButtonDown"
                             Background="LightSteelBlue">
                        <chartingToolkit:Chart.RenderTransform>
                            <ScaleTransform x:Name="scaleTransform"></ScaleTransform>
                        </chartingToolkit:Chart.RenderTransform>
                        <chartingToolkit:Chart.Series>
                            <chartingToolkit:ColumnSeries Title="Experience"  IndependentValueBinding="{Binding Path=ModelName}" DependentValueBinding="{Binding  Path=SaleCount}">
                            </chartingToolkit:ColumnSeries>
                        </chartingToolkit:Chart.Series>
                    </chartingToolkit:Chart>
                    <chartingToolkit:Chart  x:Name="mcChart2" Loaded="mcChart_Loaded"  Width="400" Height="250" Canvas.Left="410" Canvas.Top="5" MouseLeftButtonDown="brdMovable_MouseLeftButtonDown"
                             Background="LightSteelBlue">
                        <chartingToolkit:Chart.RenderTransform>
                            <ScaleTransform x:Name="scaleTransform2"></ScaleTransform>
                        </chartingToolkit:Chart.RenderTransform>
                        <chartingToolkit:Chart.Series>
                            <chartingToolkit:ColumnSeries Title="Experience2"  IndependentValueBinding="{Binding Path=ModelName}" DependentValueBinding="{Binding  Path=SaleCount}">
                            </chartingToolkit:ColumnSeries>
                        </chartingToolkit:Chart.Series>
                    </chartingToolkit:Chart>
                    <chartingToolkit:Chart  x:Name="mcChart3" Loaded="mcChart_Loaded"  Width="400" Height="250" Canvas.Left="0" Canvas.Top="270" MouseLeftButtonDown="brdMovable_MouseLeftButtonDown"
                             Background="LightSteelBlue">
                        <chartingToolkit:Chart.RenderTransform>
                            <ScaleTransform x:Name="scaleTransform3"></ScaleTransform>
                        </chartingToolkit:Chart.RenderTransform>
                        <chartingToolkit:Chart.Series>
                            <chartingToolkit:ColumnSeries Title="Experience3"  IndependentValueBinding="{Binding Path=ModelName}" DependentValueBinding="{Binding  Path=SaleCount}">
                            </chartingToolkit:ColumnSeries>
                        </chartingToolkit:Chart.Series>
                    </chartingToolkit:Chart>
                    <chartingToolkit:Chart  x:Name="mcChart4" Loaded="mcChart_Loaded"  Width="400" Height="250" Canvas.Left="410" Canvas.Top="270" MouseLeftButtonDown="brdMovable_MouseLeftButtonDown"
                             Background="LightSteelBlue">
                        <chartingToolkit:Chart.RenderTransform>
                            <ScaleTransform x:Name="scaleTransform4"></ScaleTransform>
                        </chartingToolkit:Chart.RenderTransform>
                        <chartingToolkit:Chart.Series>
                            <chartingToolkit:ColumnSeries Title="Experience4"  IndependentValueBinding="{Binding Path=ModelName}" DependentValueBinding="{Binding  Path=SaleCount}">
                            </chartingToolkit:ColumnSeries>
                        </chartingToolkit:Chart.Series>
                    </chartingToolkit:Chart>
                </Canvas>

in code behind i am dynamically passing the element and doing the zoom as below.

            Storyboard storyBoard = new Storyboard();

            ///////// X Transform
            DoubleAnimation ds = new DoubleAnimation();
            storyBoard.Children.Add(ds);
            ds.From  = 1;
            ds.To = 1.5;
            ds.Duration = new Duration(TimeSpan.FromSeconds(2));
            Storyboard.SetTargetName(ds, "scaleTransform");
            Storyboard.SetTargetProperty(ds, new PropertyPath("(ScaleX)"));

            ////Y Transform

            DoubleAnimation dsy = new DoubleAnimation();
            storyBoard.Children.Add(dsy);
            dsy.From = 1;
            dsy.To = 1.5;
            dsy.Duration = new Duration(TimeSpan.FromSeconds(2));
            Storyboard.SetTargetName(dsy, "scaleTransform");
            Storyboard.SetTargetProperty(dsy, new PropertyPath("(ScaleY)"));
            LayoutRoot.Resources.Remove("unique_id");
            LayoutRoot.Resources.Add("unique_id",storyBoard);

            storyBoard.Begin();

i am getting the zoom outside of the canvas for chart2,cahrt3,chart4.

is there anyway to get the zoom center of canvas or the relative position of the chart ?

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T19:57:53+00:00Added an answer on May 24, 2026 at 7:57 pm

    Add RenderTransformOrigin="0.5,0.5" to the element you are scaling.

    e.g.

    <Canvas x:Name="SampleCanvas" RenderTransformOrigin="0.5,0.5"...
    

    The co-ordindates in a render transform origin are a fraction of the size so 0.5, 0.5 is the middle.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using the new ASP control Chart, but I have some problems with
I have a chart control that works normally for all but one case. If
I am developing a web application which has Chart Controls. I have developed a
I have installed the new asp:chart control on my machine and have built an
So, I have a WindowsFormsHost control in my WPF app (hosting a Dundas Chart)
Have Microsoft Chart Controls been integrated into .NET 4 release of WPF? I've found
I have a strange situation using asp ajax chart controls. I have an application
I'm using Asp.net chart controls in order to display charts. I have a datatable
I have been using the ASP.NET chart controls for a while on win2k3 (32bit)
I have developed a small widget library of Chart controls and wondering if there

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.