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
Chartbook
Re: Chartbook
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:
Could you please, tell us if previous code works as you expected?
I hope will helps.
Thanks,
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);
}
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 |
Instructions - How to post in this forum |