The Get Major Minor Ticker (ast_fn_GetMajorMinorTicker) Data Block is designed to dynamically generate major and minor tick values for time-based axes in PowerPoint (PPTX) charts. This Data Block is part of Assette’s charting helper Data Blocks, allowing content creators to control and customize time intervals on a chart. It serves as a helper utility to determine date markers (ticks) that can be applied as axis labels and gridlines within PowerPoint.
Purpose and Usage #
This block helps users:
- Generate time intervals dynamically based on input parameters such as account history or chart size
- Create major/minor tick marks for use in charts (e.g., monthly, quarterly, annual intervals)
- Support flexible rendering across different chart sizes and data ranges
- Power Smart Shells or other template components that depend on time-based scaling
Note: This Data Block does not generate charts. It is intended to be used as a data source for other Data Blocks or Data Objects that consume its output to drive visual rendering in templates.
Block Details #
Attribute | Value |
---|---|
Name | ast_fn_GetMajorMinorTicker |
Block Category | Interface |
Block Type | Python |
Output Type | Data Table |
Editable | No |
Public Block | Yes |
Dependent Block | PythonEnvForDateCalculation |
Input Parameters #
This block accepts the following parameters to customize the output:
Parameter | Description |
---|---|
begin_date | The start date of the chart’s data range (YYYY-MM-DD ) |
as_of_date | The end date or effective date (YYYY-MM-DD ) |
size | Chart size (Small , Mid , or Large ), which influences spacing |
frequency | Tick frequency override (optional) |
display_frequency | Tick interval for display (e.g., monthly , quarterly , yearly , or Auto ) |
These inputs allow downstream blocks to create context-aware axis markings that adjust based on history length, chart size, or user configuration.
How It Works #
- Date Range and Age Calculation
The block first parsesbegin_date
andas_of_date
, calculates the number of years between them, and sets internal defaults based on the age of the data. - Auto-Frequency Mode If no frequency is provided, an auto-frequency is calculated based on:
- The age of the data
- The selected chart size (
Small
,Mid
,Large
) This allows older portfolios with long histories to display sparser ticks while still retaining relevance.
- Frequency Profile Determination The function uses a built-in
get_frequency()
logic that considersversion
(e.g.,"Advanced"
) and applies intelligent mappings:- Small portfolios: quarterly → biennial
- Mid portfolios: monthly → annually
- Large portfolios: monthly → auto-scaling
- Tick Generation
- If
display_frequency
is set to"Auto"
, it creates a looped list of date points based on internal frequency logic. - Otherwise, it uses
pandas.date_range()
to create ticks based on the selected frequency (monthly
,quarterly
, oryearly
).
- If
- Output Format The result is returned as a list of dictionaries: jsonCopyEdit
[ {"Period": "2021-12-31"}, {"Period": "2022-12-31"}, {"Period": "2023-12-31"} ]
This can be directly consumed by Data Objects and Smart Shells to position time-based values consistently across chart axes.
Example Use Case #
Let’s say you are building a performance chart in a factsheet that covers 10 years of history. The ast_fn_GetMajorMinorTicker
block can:
- Automatically select appropriate intervals (e.g., annual ticks for long history)
- Return a structured list of date ticks
- Feed those ticks into another Data Block, which uses them to align portfolio and benchmark values correctly along the x-axis
This helps maintain clarity and visual consistency without manually hardcoding axis values.
Best Practices #
- Use as a dependency: This block is designed to support other Data Blocks, especially those handling performance or attribution charts.
- Leverage Auto mode: Let Assette determine the best tick intervals automatically unless you have a specific design need.
- Avoid manual edits: This block is not editable and should be used as-is. Customize behavior through parameters, not internal logic.
- Incorporate into reusable templates: Use this Data Block to standardize how ticks are handled across multiple chart-based outputs in your firm.
Key Benefits #
- Automatically adapts to chart size and data range
- Reduces the need for hardcoded tick values
- Ensures consistent visual spacing across charts
- Supports multiple display modes (auto, monthly, quarterly, yearly)
- Easily integrated into templated reporting and dashboard designs