With ScrollPager tool chart no longer resizes.
Posted: Tue Feb 28, 2017 3:36 pm
We would like to allow the user to resize the form after adding the ScrollPager tool but for some reason the TChart ignores resize events and stays the same size even if docked.
With the Steema TeeChart for .NET 2016 4.1.2016.10260/.Net 4.0 version of the library if you drop a TChart onto a form and run the program resize events cause the chart to resize (since the code docs the tChart1 control).
Then uncomment the:
line and run the program again and resize the form.
With the ScrollPager tool added to the chart the chart no longer seems to be docked and the form is not able to be resized effectively.
I attached a SizeChanged event to the chart and the chart is getting events but the ScrollPager does not seem to be getting anything.
I tried docking the chartSettings.ScrollPagerTool.SubChartTChart but that does not seem to do anything either.
Any idea how to allow for resizing when a ScrollPagerTool is added to the chart?
Code: Select all
//#define ADD_SCROLL_PAGER
using Steema.TeeChart;
using Steema.TeeChart.Styles;
using Steema.TeeChart.Tools;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace ScrollPagerTest
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
InitializeChart();
}
#if (ADD_SCROLL_PAGER)
ScrollPager tool;
#endif
Steema.TeeChart.Styles.Line series;
private void InitializeChart()
{
tChart1.Dock = DockStyle.Fill;
tChart1.Header.Text = "Scroll Pager Tool";
tChart1.Series.Add(series = new Steema.TeeChart.Styles.Line());
series.FillSampleValues(1000);
series.Legend.Visible = false;
#if (ADD_SCROLL_PAGER)
tChart1.Tools.Add(tool = new ScrollPager());
tool.Series = series;
tool.SubChartTChart.Panel.Pen.Visible = false;
tool.SubChartTChart.Panel.Bevel.Inner = Steema.TeeChart.Drawing.BevelStyles.None;
tool.SubChartTChart.Panel.Bevel.Outer = Steema.TeeChart.Drawing.BevelStyles.None;
#endif
}
}
}
Then uncomment the:
Code: Select all
#define ADD_SCROLL_PAGER
With the ScrollPager tool added to the chart the chart no longer seems to be docked and the form is not able to be resized effectively.
I attached a SizeChanged event to the chart and the chart is getting events but the ScrollPager does not seem to be getting anything.
I tried docking the chartSettings.ScrollPagerTool.SubChartTChart but that does not seem to do anything either.
Any idea how to allow for resizing when a ScrollPagerTool is added to the chart?