TeeChart NET for Blazor How to hook up a chart zoom event

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
dynamicrisk
Newbie
Newbie
Posts: 11
Joined: Thu Apr 06, 2023 12:00 am

TeeChart NET for Blazor How to hook up a chart zoom event

Post by dynamicrisk » Thu Aug 29, 2024 6:55 pm

Hello,

I am trying to implement a chart zoomed event in a blazor chart and cannot seem to get it working. Should I be using the TChart.Zoomed event in c# or does this need to be done somewhere in the <canvas> tag with javascript?

Marc
Site Admin
Site Admin
Posts: 1258
Joined: Thu Oct 16, 2003 4:00 am
Location: Girona
Contact:

Re: TeeChart NET for Blazor How to hook up a chart zoom event

Post by Marc » Fri Aug 30, 2024 9:19 am

Hello,

OnZoom is a clientside Javascript event-method that can be defined using the CustomCode lines property for javascript in C#.

Example, modifying label format:

Code: Select all

  Chart1.onzoom=function() {
    var axis = Chart1.axes.bottom,
        range = axis.maximum - axis.minimum;

    if (range < 1000)
       axis.labels.dateFormat = "H:M:s:L";
  }
(taken from: https://www.steema.com/files/public/tee ... tetime.htm)

or here linking axes between charts via the synchroAxes method:

Code: Select all

  for(var t=0; t<charts.length; t++) {
    charts[t].onzoom=synchroAxes;
    charts[t].onscroll=synchroAxes;
    charts[t].zoom.onreset=synchroZoomReset;
  }
https://www.steema.com/files/public/tee ... charts.htm

Regards,
Marc Meumann
Steema Support

Post Reply