Skip to content

Commit

Permalink
Add pieces to opt.VisualMap (#276)
Browse files Browse the repository at this point in the history
Co-authored-by: Koy ['kɔɪ] <koy@ko8e24.top>
  • Loading branch information
r2p2 and Koooooo-7 committed Apr 2, 2023
1 parent edde61d commit 7471e8b
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions opts/global.go
Original file line number Diff line number Diff line change
Expand Up @@ -843,6 +843,24 @@ type SplitLine struct {
AlignWithLabel bool `json:"alignWithLabel,omitempty"`
}

// Used to customize how to slice continuous data, and some specific view style for some pieces.
type Piece struct {
Min float32 `json:"min,omitempty"`

Max float32 `json:"max,omitempty"`

Lt float32 `json:"lt,omitempty"`

Lte float32 `json:"lte,omitempty"`

Gt float32 `json:"gt,omitempty"`

Gte float32 `json:"gte,omitempty"`

// Symbol color
Color string `json:"color,omitempty"`
}

// VisualMap is a type of component for visual encoding, which maps the data to visual channels.
// https://echarts.apache.org/en/option.html#visualMap
type VisualMap struct {
Expand Down Expand Up @@ -870,6 +888,9 @@ type VisualMap struct {
// Define visual channels that will mapped from dataValues that are in selected range.
InRange *VisualMapInRange `json:"inRange,omitempty"`

// Used to customize how to slice continuous data, and some specific view style for some pieces.
Pieces []Piece `json:"pieces,omitempty"`

// Whether to show visualMap-piecewise component. If set as false,
// visualMap-piecewise component will not show,
// but it can still perform visual mapping from dataValue to visual channel in chart.
Expand Down

0 comments on commit 7471e8b

Please sign in to comment.