Click here to Skip to main content
15,892,674 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want customize chart in C# and want adding two button to it for zoom in and zoom out.
I do it and adding 2 button and added in visual studio toolbox.
but I have a problem.
after adding this new control to my projects I can not see some main future of chart in properties like ChartAreas, Legends, Series and ... .

Thanks

What I have tried:

C#
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Windows.Forms.DataVisualization.Charting;

namespace DemoCustomGraph
{
    public partial class customGraph : UserControl
    {
        public customGraph()
        {
            InitializeComponent();
        }


        private void btnScrollOnOff_Click(object sender, EventArgs e)
        {
            if(chart1.ChartAreas["ChartArea1"].CursorX.AutoScroll == false)
            {
                chart1.ChartAreas["ChartArea1"].CursorX.AutoScroll = true;
                btnScrollOnOff.Text = "Scroll On";
            }
            else
            {
                chart1.ChartAreas["ChartArea1"].CursorX.AutoScroll = false;
                btnScrollOnOff.Text = "Scroll Off";
            }
        }
    }
}
Posted
Comments
BillWoodruff 7-Jul-19 2:58am    
"I can not see some main future of chart in properties like ChartAreas, Legends, Series and ..." So define those in a container that cannot be zoomed ?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900