We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How can I change the zoom / pan icons to my defined icons?

Thread ID:

Created:

Updated:

Platform:

Replies:

146381 Aug 2,2019 02:04 AM UTC Aug 2,2019 01:32 PM UTC WPF 3
loading
Tags: SfChart
Brian McCombs
Asked On August 2, 2019 02:04 AM UTC

Hello, we are currently using your sfchart for a graph and utilize the zoom pan icons on this chart. However I would like to change the pan icon from arrows to a hand. Can you please help me understand how to change out the icons for my own? 


Muneesh Kumar G [Syncfusion]
Replied On August 2, 2019 07:11 AM UTC

Hi Brain, 
 
Greetings from Syncfusion.  
 
We have analyzed your requirement and we would like to inform you that we have support to customize the items display in the toolbar only. We don’t have support to customize the individual item’s icon and other options.  
 
Thanks,    
Muneesh Kumar G.   
 


Brian McCombs
Replied On August 2, 2019 12:33 PM UTC

Ok, so can you think of some other ways I can do this. I see in some other controls that you have just simple commands to zoom, do these apply to the sfchart. So I can just make my own canvas with icons and then individually send the commands. Do you have any examples of this? 


Muneesh Kumar G [Syncfusion]
Replied On August 2, 2019 01:32 PM UTC

Hi Brain,  
 
Greetings from Syncfusion.  
 
We have analyzed your requirement and we have achieved this by creating custom panel with zooming action buttons and performed the action for each button click as per the below code snippet.  
 
Code snippet 
 
  <chart:SfChart  Grid.Row="1" Margin="10" 
                       x:Name="chart" > 
            <chart:SfChart.Behaviors> 
                <chart:ChartZoomPanBehavior x:Name="zoom"/> 
            </chart:SfChart.Behaviors> 
             
            <chart:SfChart.PrimaryAxis> 
                <chart:NumericalAxis x:Name="xAxis" /> 
            </chart:SfChart.PrimaryAxis> 
             
            <chart:SfChart.SecondaryAxis> 
                <chart:NumericalAxis x:Name="yAxis" EdgeLabelsDrawingMode="Shift"> 
                </chart:NumericalAxis> 
            </chart:SfChart.SecondaryAxis> 
 
            <chart:ColumnSeries XBindingPath="XValue"  
                                Label="Series" 
                                YBindingPath="YValue" 
                             ItemsSource="{Binding Data}"/> 
 
        </chart:SfChart> 
        <StackPanel Orientation="Horizontal" Margin="10" 
                    Height="30" 
                    VerticalAlignment="Top" HorizontalAlignment="Right"> 
            <Button Content="ZoomIn" Margin="2" x:Name="zoomIn" Click="zoomIn_Click"/> 
            <Button Content="ZoomOut" Margin="2" x:Name="zoomOut" Click="zoomOut_Click"/> 
            <Button Content="Reset" Margin="2" x:Name="reset" Click="reset_Click"/> 
            <Button Content="Panning" Margin="2" x:Name="pan" Click="pan_Click"/> 
            <Button Content="Select Zoom" Margin="2" x:Name="select" Click="select_Click"/> 
        </StackPanel> 
 
 
private void zoomIn_Click(object sender, RoutedEventArgs e) 
        { 
            xAxis.ZoomFactor = xAxis.ZoomFactor - 0.2; 
            yAxis.ZoomFactor = yAxis.ZoomFactor - 0.2; 
        } 
 
        private void zoomOut_Click(object sender, RoutedEventArgs e) 
        { 
            xAxis.ZoomFactor = xAxis.ZoomFactor + 0.2; 
            yAxis.ZoomFactor = yAxis.ZoomFactor + 0.2; 
        } 
 
        private void pan_Click(object sender, RoutedEventArgs e) 
        { 
            zoom.EnablePanning = true; 
            zoom.EnableSelectionZooming = false; 
        } 
 
        private void select_Click(object sender, RoutedEventArgs e) 
        { 
            zoom.EnablePanning = false; 
            zoom.EnableSelectionZooming = true; 
        } 
 
        private void reset_Click(object sender, RoutedEventArgs e) 
        { 
            zoom.Reset(); 
        } 
    } 
 
We have prepared a sample based on this, please find the sample from the following location.  
 
 
You can modify the button contents as text or image based on your requirement.  
 
Screenshot:  
 
 
Please let us know if you have any other queries.  
 
Thanks,    
Muneesh Kumar G.    
 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon