Issue setting range start and end.

Hi,

I am trying to understand how to set the start and end values for my range navigator control.

I can see from the documentation that it is set using the Value property, but I can't see which format the data should be in when passed to this method.

I've tried passing a List<DateTime> and a DateTime[] with two datetimes representing start and end values, but I get the same error.

rangeNavError.PNG

Can you please show me how to set a start and end value for the range navigator control?


Regards,

Craig


3 Replies 1 reply marked as answer

NP Nishanthi Panner Selvam Syncfusion Team August 11, 2023 12:32 PM UTC

Craig,


Greetings from Syncfusion.


We have created a rangeNavigator sample by setting a value, which serves as the start and end values for range.


We have attached sample, code-snippet and screenshot for your reference.


Code-snippet:


@(Html.EJS().RangeNavigator("print-container")

    .ValueType(Syncfusion.EJ2.Charts.RangeValueType.DateTime)

    .LabelFormat("MMM-yy")

    .Value(new List<DateTime> { new DateTime(2008, 01, 01), new DateTime(2009, 01, 01) })

    .Series(sr =>

    {

sr.XName("x").YName("y").DataSource(ViewBag.dataSource).Type(Syncfusion.EJ2.Charts.RangeNavigatorType.Area).Add();

    })

    .Render()

).


Sample:



Kindly revert us if you have any concerns.


Regards,

Nishanthi



Attachment: Rangenavigator_sample_885c4ff3.zip


CB Craig B replied to Nishanthi Panner Selvam August 11, 2023 03:49 PM UTC

Thanks for your reply Nishanthi.

I have tried your suggested method but still get the same issue.


The datetimes in my datasource are in the format YYYY-MM-DD hh:mm:ss​.

Could this be causing the issue?



NP Nishanthi Panner Selvam Syncfusion Team August 14, 2023 12:11 PM UTC

Craig,


We have ensured your reported scenario by setting labelFormat as ‘yyyy-MM-dd hh:mm:ss’ and value also in the same format, range navigator is rendered as per behavior. We have attached the tested sample and screenshot for your reference. Please check with below snippet and sample.


Code-snippet:


@(Html.EJS().RangeNavigator("print-container")

    .ValueType(Syncfusion.EJ2.Charts.RangeValueType.DateTime)

    .LabelFormat("yyyy-MM-dd hh:mm:ss​")

    .Value(new List<DateTime> { new DateTime(2008, 01, 01, 13, 08, 09), new DateTime(2009, 01, 01, 05, 03, 07) })

    .Series(sr =>

    {

        sr.XName("x").YName("y").DataSource(ViewBag.dataSource).Type(Syncfusion.EJ2.Charts.RangeNavigatorType.Area).Add();

    })

    .Render()

).


Screenshot:



Since we are unable to replicate an issue from our end, we request you to share the following information which will be helpful for further analysis and provide you the solution sooner.

  • Try to reproduce the reported scenario in above sample.
  • Please share your sample (or) code snippet with full configurations.



Regards,

Nishanthi


Attachment: dateTime_start_and_end_range_d58e0ae.zip

Marked as answer
Loader.
Up arrow icon