次のように、TeeChart で .Net コントロールを実装したいと考えています。1 つのチャートをズームする場合、他のチャートも同期してズームする必要があります。2. 各グラフには複数の水平線が含まれており、それぞれが一意の水平軸に対応しています。
1 に答える
0
の機能デモの例をご覧くださいAll Features\Welcome !\Axes\Opaque zones
。機能のデモは、TeeChart のインストールに同梱されているプログラムで、コンポーネントがサポートする主な機能の例が含まれています。
複数TChart
の があり、それらを同期したい場合は、Scroll
両方のチャートでイベントを処理できます。すなわち:
public Form1()
{
InitializeComponent();
CreateChart();
InitializeChart();
}
Steema.TeeChart.TChart tChart1, tChart2;
private void CreateChart()
{
tChart1 = new Steema.TeeChart.TChart();
this.Controls.Add(tChart1);
tChart2 = new Steema.TeeChart.TChart();
this.Controls.Add(tChart2);
tChart1.Dock = DockStyle.Left;
tChart2.Dock = DockStyle.Right;
}
private void InitializeChart()
{
tChart1.Aspect.View3D = false;
tChart2.Aspect.View3D = false;
Line line1 = new Line(tChart1.Chart);
line1.FillSampleValues();
Line line2 = new Line(tChart2.Chart);
line2.DataSource = line1;
tChart1.Scroll += new EventHandler(tChart1_Scroll);
tChart2.Scroll += new EventHandler(tChart2_Scroll);
}
void tChart1_Scroll(object sender, EventArgs e)
{
tChart2.Axes.Left.SetMinMax(tChart1.Axes.Left.Minimum, tChart1.Axes.Left.Maximum);
tChart2.Axes.Bottom.SetMinMax(tChart1.Axes.Bottom.Minimum, tChart1.Axes.Bottom.Maximum);
}
void tChart2_Scroll(object sender, EventArgs e)
{
tChart1.Axes.Left.SetMinMax(tChart2.Axes.Left.Minimum, tChart2.Axes.Left.Maximum);
tChart1.Axes.Bottom.SetMinMax(tChart2.Axes.Bottom.Minimum, tChart2.Axes.Bottom.Maximum);
}
于 2013-09-30T08:38:52.247 に答える