Closed sam-wheat closed 6 months ago
Have you checked https://apexcharts.github.io/Blazor-ApexCharts/methods/zoomx You should be able to trigger it after OnUpdated event, https://apexcharts.github.io/Blazor-ApexCharts/events/chart-setup
Please note I have not tested this myself.
Thank you @joadan this looks like what I need. However when I use this the chart does not render any series. If at all possible I want to zoom the chart before it is rendered using the entire dataset because it takes too long to render.
<ApexChart OnUpdated="Zoom"> // no data rendered
<ApexChart OnBeforeMount="Zoom"> // no data rendered
private async Task Zoom()
{
DateTime maxObs = obs.Max(x => x.ObsDate);
DateTime minObs = obs.Where(x => x.ObsDate < maxObs.AddDays(-50)).Max(x => x.ObsDate);
await chart.ZoomXAsync(minObs.ToUnixTimeMilliseconds(), maxObs.ToUnixTimeMilliseconds());
}
I close this now, I don' see how the wrapper can do anything more here.
I have ~2500 data points. I want to render the chart zoomed to the last 1000. Is this possible? I did see this document however it does not describe how to select the elements to include in the zoom area. Thanks.