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

Add AxisPointer option set with basic config #164

Merged
merged 1 commit into from Mar 10, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
21 changes: 21 additions & 0 deletions opts/global.go
Expand Up @@ -253,6 +253,7 @@ type Legend struct {
}

// Tooltip is the option set for a tooltip component.
// https://echarts.apache.org/en/option.html#tooltip
type Tooltip struct {
// Whether to show the tooltip component, including tooltip floating layer and axisPointer.
Show bool `json:"show"`
Expand Down Expand Up @@ -331,6 +332,26 @@ type Tooltip struct {
// percent: number,
// }
Formatter string `json:"formatter,omitempty"`

// Configuration item for axisPointer
AxisPointer *AxisPointer `json:"axisPointer,omitempty"`
}

// AxisPointer is the option set for an axisPointer component
// https://echarts.apache.org/en/option.html#axisPointer
type AxisPointer struct {

// Indicator type.
// Options:
// - 'line' line indicator.
// - 'shadow' shadow crosshair indicator.
// - 'none' no indicator displayed.
// - 'cross' crosshair indicator, which is actually the shortcut of enable two axisPointers of two orthometric axes.
Type string `json:"type,omitempty"`

// Whether snap to point automatically. The default value is auto determined.
// This feature usually makes sense in value axis and time axis, where tiny points can be seeked automatically.
Snap bool `json:"snap,omitempty"`
}

// Toolbox is the option set for a toolbox component.
Expand Down