kkpoon/elm-echarts/6.1.0

NOTE: this package is not compatible with Elm 0.19.1

ECharts.Style

Chart layout and style related options

Chart Title Options

type alias TitleOption =
{ show : Maybe Bool
, text : Maybe String
, link : Maybe String
, target : Maybe String
, textStyle : Maybe TextStyleOption
, textAlign : Maybe HorizontalAlignment
, textBaseline : Maybe VerticalAlignment
, subtext : Maybe String
, sublink : Maybe String
, subtarget : Maybe String
, subTextStyle : Maybe TextStyleOption
, padding : Maybe Spacing
, itemGap : Maybe Float
, zlevel : Maybe Int
, z : Maybe Int
, left : Maybe String
, top : Maybe String
, right : Maybe String
, bottom : Maybe String
, backgroundColor : Maybe String
, borderColor : Maybe String
, borderWidth : Maybe String
, shadowBlur : Maybe Int
, shadowColor : Maybe String
, shadowOffsetX : Maybe Int
, shadowOffsetY : Maybe Int
}

describe the chart title option

defaultTitleOption : TitleOption

create a title option of for default value

This function creates an All-Nothing TitleOption. ECharts applies the default value when the option attribute is not specified.

encodeTitleOption : TitleOption -> Value

encode the title option to Json.Encode.Value

Tooltip Options

type alias TooltipOption =
{ show : Maybe Bool
, showContent : Maybe Bool
, trigger : Maybe TooltipTrigger
, triggerOn : Maybe TooltipTriggerOn
, alwaysShowContent : Maybe Bool
, showDelay : Maybe Int
, hideDelay : Maybe Int
, enterable : Maybe Bool
, position : Maybe TooltipPosition
, confine : Maybe Bool
, transitionDuration : Maybe Float
, formatter : Maybe String
, backgroundColor : Maybe String
, borderColor : Maybe String
, borderWidth : Maybe String
, padding : Maybe Spacing
, textStyle : Maybe TextStyleOption
, extraCssText : Maybe String
, axisPointer : Maybe TooltipAxisPointerOption
, data :
Maybe
(List
{ date : String
, value : Float
, name : String
}
)
}

describe the tooltip option

defaultTooltipOption : TooltipOption

create a tooltip option of for default value

This function creates an All-Nothing TitleOption. ECharts applies the default value when the option attribute is not specified.

encodeTooltipOption : TooltipOption -> Value

encode the tooltip option to Json.Encode.Value

{ type_ : Maybe TooltipAxisPointerType
, axis : Maybe String
, animation : Maybe Bool
, animationThreshold : Maybe Int
, animationDuration : Maybe Int
, animationEasing : Maybe AnimationEasing
, animationDelay : Maybe Int
, animationDurationUpdate : Maybe Int
, animationEasingUpdate : Maybe AnimationEasing
, animationDelayUpdate : Maybe Int
, lineStyle : Maybe LineStyleOption
, crossStyle : Maybe CrossStyleOption
, shadowStyle : Maybe ShadowStyleOption
}

describe the tooltip axis pointer option

defaultTooltipAxisPointerOption : TooltipAxisPointerOption

create a tooltip axis pointer option of for default value

This function creates an All-Nothing TitleOption. ECharts applies the default value when the option attribute is not specified.

Tooltip Attribute Values

= TriggerByItem
| TriggerByAxis

tooltip trigger value

= MouseMoveTriggerTooltip
| ClickTriggerTooltip
| NoneTriggerTooltip

tooltip triggerOn value

= AbsoluteTooltipPosiotion Int Int
| RelativeTooltipPosition String String

tooltip position value

= LineTooltipAxisPointer
| CrossTooltipAxisPointer
| ShadowTooltipAxisPointer

tooltip axis pointer type value

Legend Options

type alias LegendOption =
{ show : Maybe Bool
, zlevel : Maybe Int
, z : Maybe Int
, left : Maybe String
, top : Maybe String
, right : Maybe String
, bottom : Maybe String
, width : Maybe String
, height : Maybe String
, orient : Maybe Orientation
, align : Maybe LegendAlignment
, padding : Maybe Spacing
, itemGap : Maybe Int
, itemWidth : Maybe Int
, itemHeight : Maybe Int
, formatter : Maybe String
, selectedMode : Maybe SelectedMode
, inactiveColor : Maybe String
, selected : Maybe (List ( String, Bool ))
, textStyle : Maybe TextStyleOption
, tooltip : Maybe TooltipOption
, data :
Maybe
(List
{ name : String
, icon : String
, textStyle : TextStyleOption
}
)
, backgroundColor : Maybe String
, borderColor : Maybe String
, borderWidth : Maybe Int
, shadowBlur : Maybe Int
, shadowColor : Maybe String
, shadowOffsetX : Maybe Int
, shadowOffsetY : Maybe Int
}

describe the legend option

defaultLegendOption : LegendOption

create a legend option of for default value

This function creates an All-Nothing TitleOption. ECharts applies the default value when the option attribute is not specified.

encodeLegendOption : LegendOption -> Value

encode the legend option to Json.Encode.Value

XAxis Options

type alias XAxisOption =
{ show : Maybe Bool
, type_ : Maybe String
, data :
Maybe
(List
{ value : String
, textStyle : TextStyleOption
}
)
}

describe the xAxis option

defaultXAxisOption : XAxisOption

create a xAxis option of for default value

This function creates an All-Nothing XAxisOption. ECharts applies the default value when the option attribute is not specified.

encodeXAxisOption : XAxisOption -> Value

encode the xAxis option to Json.Encode.Value

YAxis Options

type alias YAxisOption =
{ show : Maybe Bool
, type_ : Maybe String
, data :
Maybe
(List
{ value : String
, textStyle : TextStyleOption
}
)
}

describe the yAxis option

defaultYAxisOption : YAxisOption

create a yAxis option of for default value

This function creates an All-Nothing YAxisOption. ECharts applies the default value when the option attribute is not specified.

encodeYAxisOption : YAxisOption -> Value

encode the yAxis option to Json.Encode.Value

Legend Attribute Values

= AutoLegendAlignment
| LeftLegendAlignment
| RightLegendAlignment

legend alignment value

Style Options

type alias LineStyleOption =
{ color : Maybe String
, width : Maybe Int
, type_ : Maybe LineStyleType
, shadowBlur : Maybe Int
, shadowColor : Maybe String
, shadowOffsetX : Maybe Int
, shadowOffsetY : Maybe Int
, opacity : Maybe Float
}

describe the line style option

defaultLineStyleOption : LineStyleOption

create a line style option of for default value

This function creates an All-Nothing TitleOption. ECharts applies the default value when the option attribute is not specified.

encodeLineStyleOption : LineStyleOption -> Value

encode the line style option to Json.Encode.Value

type alias CrossStyleOption =
{ color : Maybe String
, width : Maybe Int
, type_ : Maybe LineStyleType
, shadowBlur : Maybe Int
, shadowColor : Maybe String
, shadowOffsetX : Maybe Int
, shadowOffsetY : Maybe Int
, opacity : Maybe Float
, textStyle : Maybe TextStyleOption
}

describe the cross style option

defaultCrossStyleOption : CrossStyleOption

create a cross style option of for default value

This function creates an All-Nothing TitleOption. ECharts applies the default value when the option attribute is not specified.

encodeCrossStyleOption : CrossStyleOption -> Value

encode the cross style option to Json.Encode.Value

type alias ShadowStyleOption =
{ color : Maybe String
, shadowBlur : Maybe Int
, shadowColor : Maybe String
, shadowOffsetX : Maybe Int
, shadowOffsetY : Maybe Int
, opacity : Maybe Float
}

describe the shadow style option

defaultShadowStyleOption : ShadowStyleOption

create a shadow style option of for default value

This function creates an All-Nothing TitleOption. ECharts applies the default value when the option attribute is not specified.

encodeShadowStyleOption : ShadowStyleOption -> Value

encode the shadow option to Json.Encode.Value

type alias TextStyleOption =
{ color : Maybe String
, fontStyle : Maybe String
, fontWeight : Maybe String
, fontFamily : Maybe String
, fontSize : Maybe Float
}

describe the text style option

defaultTextStyleOption : TextStyleOption

create a text style option of for default value

This function creates an All-Nothing TitleOption. ECharts applies the default value when the option attribute is not specified.

encodeTextStyleOption : TextStyleOption -> Value

encode the text style option to Json.Encode.Value

Style Attribute Values

= Horizontal
| Vertical

describe the orientation attribute

encodeOrientationValue : Orientation -> Value

encode the orientation value to Json.Encode.Value

= Left
| Center
| Right

describe horizontal alignment: left, center, right

encodeHorizontalAlignmentValue : HorizontalAlignment -> Value

encode the horizontal alignment value to Json.Encode.Value

= Top
| Middle
| Bottom

describe vertical alignment: top, middle, bottom

encodeVerticalAlignmentValue : VerticalAlignment -> Value

encode the vertical alignment value to Json.Encode.Value

type Spacing
= Spacing Float
| VHSpacing Float Float
| FineSpacing Float Float Float Float

describe spacing setting

encodeSpacingValue : Spacing -> Value

encode the spacing value to Json.Encode.Value

= TrueSelectedMode
| FalseSelectedMode
| SingleSelectedMode
| MultipleSelectedMode

describe the item selected mode

encodeSelectedModeValue : SelectedMode -> Value

encode the selected mode value to Json.Encode.Value

= CubicOutAnimationEasing

describe the animation easing

encodeAnimationEasingValue : AnimationEasing -> Value

encode the animation easing value to Json.Encode.Value

= SolidLine
| DashedLine
| DottedLine

describe the line style type

encodeLineStyleTypeValue : LineStyleType -> Value

encode the line style type value to Json.Encode.Value