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?
TeeChart NET for Blazor How to hook up a chart zoom event
-
- Newbie
- Posts: 23
- Joined: Thu Apr 06, 2023 12:00 am
Re: TeeChart NET for Blazor How to hook up a chart zoom event
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:
(taken from: https://www.steema.com/files/public/tee ... tetime.htm)
or here linking axes between charts via the synchroAxes method:
https://www.steema.com/files/public/tee ... charts.htm
Regards,
Marc Meumann
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";
}
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;
}
Regards,
Marc Meumann
Steema Support