Change ColorBandTool Location of ScrollPager on mouse click.

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
amol
Advanced
Posts: 231
Joined: Tue Mar 29, 2005 5:00 am

Change ColorBandTool Location of ScrollPager on mouse click.

Post by amol » Tue Sep 15, 2015 4:50 am

Hi steema,

We have some query regarding Location of ColorBandTool Location of ScrollPager on mouse click.

1. We want to Change the ColorBandTool Location of ScrollPager where mouse is clicked on Subchart of Scrollpager.
Location.png
Image 1
Location.png (37.06 KiB) Viewed 5073 times

Christopher
Guru
Posts: 1603
Joined: Fri Nov 15, 2002 12:00 am

Re: Change ColorBandTool Location of ScrollPager on mouse click.

Post by Christopher » Tue Sep 15, 2015 4:12 pm

amol wrote:1. We want to Change the ColorBandTool Location of ScrollPager where mouse is clicked on Subchart of Scrollpager.
You can try something similar to this:

Code: Select all

    Line series;
    ScrollPager tool;
    private void InitializeChart()
    {
      series = new Line(tChart1.Chart);
      tool = new ScrollPager(tChart1.Chart);

      series.FillSampleValues(100);
      tool.Series = series;

      tool.SubChartTChart.MouseDown += SubChartTChart_MouseDown;
    }

    private void SubChartTChart_MouseDown(object sender, MouseEventArgs e)
    {
      double start = tool.ColorBandTool.Start;
      double end = tool.ColorBandTool.End;
      double range = (end - start);


      double xval = tool.SubChartTChart[0].XScreenToValue(e.X);
      tChart1.Header.Text = xval.ToString();

      tool.EndValue = (range / 2) + xval;
      tool.StartValue = tool.EndValue - range;
    }
Best Regards,
Christopher Ireland / 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

Post Reply