Chartbook

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
AGF
Newbie
Newbie
Posts: 34
Joined: Mon Feb 21, 2011 12:00 am

Chartbook

Post by AGF » Fri Jul 29, 2011 7:56 am

Hi,

i have some questions arround the Chartbook tools.

Is it possible to disable the includes Contextmenü?

Is the the possibility to export Charts from an Chartbook as bulk?

Thanks

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: Chartbook

Post by Sandra » Mon Aug 01, 2011 1:50 pm

Hello AGF,

I have made a simple example where you can see how you do to delete/add Items in MenuContext and how to export Charts of ChartBook as bulk:

Code: Select all

        public Form1()
        {
            InitializeComponent();
            InitializeChart();

        }
        Steema.TeeChart.TChart tChart;
        Steema.TeeChart.ChartBook chartBook1;
        MenuItem menuItemadd; // MenuItem. 
        private void InitializeChart()
        {
            //InitializeChartBook.
            chartBook1 = new Steema.TeeChart.ChartBook();
            this.Controls.Add(chartBook1);
            chartBook1.Dock = DockStyle.Fill;

            chartBook1.Alignment = TabAlignment.Left;
            chartBook1.AddChart().Series.Add(typeof(Steema.TeeChart.Styles.Line)).FillSampleValues();
            chartBook1.AddChart().Series.Add(typeof(Steema.TeeChart.Styles.Bar)).FillSampleValues();
            chartBook1.AddChart().Series.Add(typeof(Steema.TeeChart.Styles.Area)).FillSampleValues();
            chartBook1.AddChart().Series.Add(typeof(Steema.TeeChart.Styles.Pie)).FillSampleValues();

            chartBook1.SelectedIndex = 0;//To default is, so if it is not necessary. 
            
            //Export All Charts.
            for (int i = 0; i < chartBook1.TabPages.Count; i++)
            {
                tChart = (Steema.TeeChart.TChart)chartBook1.TabPages[i].Controls[0];
                tChart.Export.Image.JPEG.Save(@"C:\tmp\ChartBook" + i.ToString() + ".jpg");
            }
        }
        private void RemoveMenuItems_Click(object sender, EventArgs e)
        {
            //example as you do to remove items. 
            chartBook1.ContextMenu.MenuItems.Remove(menuItemadd);
        }

        private void AddMenuItems_Click(object sender, EventArgs e)
        {
            //Example as you do to add items.
             menuItemadd = new MenuItem("NewName");
            chartBook1.ContextMenu.MenuItems.Add(menuItemadd);
        }
Could you please, tell us if previous code works as you expected?

I hope will helps.

Thanks,
Best Regards,
Sandra Pazos / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply