new DateSegment()
- Since:
-
10.3.0
Methods
-
getFormattedStartDateDifference(dateA, dateB)
-
Returns a formatted string showing the difference between two dates with appropriate time unit. The result shows the signed difference (e.g., "-30 minutes", "+6 months") using the most appropriate time unit for the magnitude of the difference.
Parameters:
Name Type Description dateADate The first date for comparison
dateBDate The second date for comparison
- Since:
-
10.3.0
Returns:
Formatted string showing the signed difference with time unit
- Type
- string
-
getFormattedStartDateDifference(date)
-
Returns a formatted string showing the difference between the provided date and the chart's visible start date. The result is a human-readable string with the signed difference and appropriate time unit (e.g., "-30 minutes", "+6 months").
Parameters:
Name Type Description dateDate The date to compare against the chart's visible start date
- See:
-
- getVisibleDateRange
- getFormattedDateDifference
Returns:
Formatted string showing the signed difference with time unit
- Type
- string
-
getNearestPeriodicity()
-
Returns a Periodicity object that best matches the periodicity of the added dataset
- Since:
-
10.3.0
Returns:
Periodicity object
-
getNearestStartDate(panAmount)
-
Internally finds an item whose date is nearest to the start date or end date of the chart.
Returns a start date, which, when applied to the chart via CIQ.ChartEngine#setStartDate, ensures that the nearest item is at least
panAmountfrom the nearest chart start or end boundary.Parameters:
Name Type Description panAmountnumber Value between 0 and 1 that represents where the nearest dataset date should appear on the chart (0 = at start, 1 = at end, 0.5 = in center)
- Since:
-
10.3.0
Returns:
Start date
- Type
- Date
-
getStartDateDifference(date)
-
Returns the absolute difference in milliseconds between the provided date and the chart's visible start date. This is useful for comparing temporal distances when a numeric value is needed rather than a formatted string.
Parameters:
Name Type Description dateDate The date to compare against the chart's visible start date
- Since:
-
10.3.0
- See:
-
- getVisibleDateRange
- getDateDistance
Returns:
The absolute difference in milliseconds
- Type
- number
-
getVisibility()
-
Returns a number between 0 and 1 representing the percentage of visible items in the added dataset
- Since:
-
10.3.0
Returns:
Percent visible
- Type
- number
