Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initialize the display range of the spline #72

Closed
Cyycl opened this issue Jan 15, 2020 · 1 comment
Closed

Initialize the display range of the spline #72

Cyycl opened this issue Jan 15, 2020 · 1 comment

Comments

@Cyycl
Copy link

Cyycl commented Jan 15, 2020

There are 100 days of data, and I want to display the data for the last 30 days by default,the rest of the data is displayed by sliding or by zoom.

@dharanidharandharmasivam
Copy link
Contributor

Hi @Cyycl ,

We have analyzed your query. Your requirement can be achieved using the visibleMinimum and visibleMaximum properties of the axis. Here you need to specify the range which needs to visible in the viewport and enable the panning to pan the data which are not in the viewport.

We have prepared a sample in which we have 100 days, out of that we have shown the last 30 days in the viewport. To see the remaining days, you can pan the chart to view others. Find the code snippet below.

SfCartesianChart(
      primaryXAxis: DateTimeAxis(
        visibleMinimum: chartData[chartData.length-29].x,
        visibleMaximum: chartData[chartData.length-1].x
      ),
      zoomPanBehavior: ZoomPanBehavior(
        enablePanning: true, 
      ),
      //Other configurations
    ),

Sample for reference can be found from below link.
https://www.syncfusion.com/downloads/support/directtrac/general/ze/chart_sample262274477

Note: To use the above visibleMinimum and visibleMaximum properties, kindly use the v17.4.43 from the pub.

Thanks,
Dharani.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants