VSeed, an elegant data composer, transforming complexity into simplicity.
!!!###!!!title=Timeline——VisActor/VChart tutorial documents!!!###!!!!!!###!!!description=Timeline Chart is a visualization chart used to display events in chronological order, particularly suitable for showing project progress, corporate development history, product iteration processes, and similar scenarios.VChart provides a timeline chart extension component that supports both horizontal and vertical layout modes, with flexible configuration of event node styles, label positions, icons, and other elements.!!!###!!!
Extension Chart: Timeline Chart
Timeline Chart is a visualization chart used to display events in chronological order, particularly suitable for showing project progress, corporate development history, product iteration processes, and similar scenarios.
VChart provides a timeline chart extension component that supports both horizontal and vertical layout modes, with flexible configuration of event node styles, label positions, icons, and other elements.
How to Use Extension Charts
Timeline charts need to be manually registered before use. The registration and usage methods are as follows:
export interface ITimelineChartSpec extends ICartesianChartSpec {
type: 'timeline'; /**
* Timeline direction
* - 'horizontal': Horizontal direction, time flows from left to right
* - 'vertical': Vertical direction, time flows from top to bottom
*/
direction?: 'horizontal' | 'vertical'; /**
* Series configuration
*/
series?: IEventSeriesSpec[];}
Event Series Configuration
export interface IEventSeriesSpec extends ICartesianSeriesSpec {
type: 'event';
/**
* Time field, used to specify the position of events on the timeline
*/
timeField?: string;
/**
* Event name field
*/
eventField?: string;
/**
* Event detail field (subtitle)
*/
subTitleField?: string;
/**
* Icon field, used todisplay icons or images
*/
iconField?: string;
/**
* Series field, used for grouped display */
seriesField?: string;
/**
* Position of title and subtitle
* - Horizontal layout:'top' | 'bottom' | 'top-bottom' | 'bottom-top' * - Vertical layout:'left' | 'right' | 'left-right' | 'right-left' */
labelPosition?: LabelPosition;
/**
* Icon mark configuration
* offset: Icon offset distance relative to the dot, in pixels. Positive values offset outward, negative values offset inward
*/
icon?: IMarkSpec<ISymbolMarkSpec> & { offset?: number };
/**
* Event title mark configuration
* subTitleGap: Gap between title and subtitle, in pixels
* offset: Title offset distance relative to the dot, in pixels. Positive values offset outward, negative values offset inward
*/
title?: IMarkSpec<ITextMarkSpec> & { subTitleGap?: number; offset?: number };
/**
* Event subtitle mark configuration
*/
subTitle?: IMarkSpec<ITextMarkSpec>;
/**
* Event linemark configuration
*/
line?: IMarkSpec<ILineMarkSpec>;
/**
* Arrow mark configuration
* thickness: Arrow thickness, in pixels
*/
arrow?: IMarkSpec<IPathMarkSpec> & { thickness?: number };
}
By configuring seriesField, you can implement grouped display of multiple timelines, suitable for comparing timelines of multiple themes or categories.
Interactive Features
Timeline charts support the following interactive features:
Tooltip: When hovering over dot marks, icons, or arrows, detailed event information is displayed
Click Events: You can listen to click events on dot marks to implement custom interactions
Application Scenarios
Timeline charts are suitable for the following scenarios:
Project Management: Display project milestones and key nodes
Corporate Development: Show company development history and important events
Product Iteration: Display product version update history
Historical Events: Show chronological order of historical events
Resume: Display work experience and educational background
Notes
Time fields should be numeric or date types to ensure correct sorting
When using seriesField for grouping, reasonably control the number of groups to avoid overcrowded charts
Label position selection should consider content length and chart space to avoid text overlap
Icon size should coordinate with the overall layout, not too large or too small