kkpoon / elm-echarts / ECharts.Style

Chart layout and style related options

Chart Title Options


type alias TitleOption =
{ show : Maybe Basics.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 Basics.Float
, zlevel : Maybe Basics.Int
, z : Maybe Basics.Int
, left : Maybe String
, top : Maybe String
, right : Maybe String
, bottom : Maybe String
, backgroundColor : Maybe String
, borderColor : Maybe String
, borderWidth : Maybe String
, shadowBlur : Maybe Basics.Int
, shadowColor : Maybe String
, shadowOffsetX : Maybe Basics.Int
, shadowOffsetY : Maybe Basics.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 -> Json.Encode.Value

encode the title option to Json.Encode.Value

Tooltip Options


type alias TooltipOption =
{ show : Maybe Basics.Bool
, showContent : Maybe Basics.Bool
, trigger : Maybe TooltipTrigger
, triggerOn : Maybe TooltipTriggerOn
, alwaysShowContent : Maybe Basics.Bool
, showDelay : Maybe Basics.Int
, hideDelay : Maybe Basics.Int
, enterable : Maybe Basics.Bool
, position : Maybe TooltipPosition
, confine : Maybe Basics.Bool
, transitionDuration : Maybe Basics.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 : Basics.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 -> Json.Encode.Value

encode the tooltip option to Json.Encode.Value


type alias TooltipAxisPointerOption =
{ type_ : Maybe TooltipAxisPointerType
, axis : Maybe String
, animation : Maybe Basics.Bool
, animationThreshold : Maybe Basics.Int
, animationDuration : Maybe Basics.Int
, animationEasing : Maybe AnimationEasing
, animationDelay : Maybe Basics.Int
, animationDurationUpdate : Maybe Basics.Int
, animationEasingUpdate : Maybe AnimationEasing
, animationDelayUpdate : Maybe Basics.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


type TooltipTrigger
    = TriggerByItem
    | TriggerByAxis

tooltip trigger value


type TooltipTriggerOn
    = MouseMoveTriggerTooltip
    | ClickTriggerTooltip
    | NoneTriggerTooltip

tooltip triggerOn value


type TooltipPosition
    = AbsoluteTooltipPosiotion Basics.Int Basics.Int
    | RelativeTooltipPosition String String

tooltip position value


type TooltipAxisPointerType
    = LineTooltipAxisPointer
    | CrossTooltipAxisPointer
    | ShadowTooltipAxisPointer

tooltip axis pointer type value

Legend Options


type alias LegendOption =
{ show : Maybe Basics.Bool
, zlevel : Maybe Basics.Int
, z : Maybe Basics.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 Basics.Int
, itemWidth : Maybe Basics.Int
, itemHeight : Maybe Basics.Int
, formatter : Maybe String
, selectedMode : Maybe SelectedMode
, inactiveColor : Maybe String
, selected : Maybe (List ( String
, Basics.Bool ))
, textStyle : Maybe TextStyleOption
, tooltip : Maybe TooltipOption
, data : Maybe (List { name : String
, icon : String
, textStyle : TextStyleOption })
, backgroundColor : Maybe String
, borderColor : Maybe String
, borderWidth : Maybe Basics.Int
, shadowBlur : Maybe Basics.Int
, shadowColor : Maybe String
, shadowOffsetX : Maybe Basics.Int
, shadowOffsetY : Maybe Basics.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 -> Json.Encode.Value

encode the legend option to Json.Encode.Value

XAxis Options


type alias XAxisOption =
{ show : Maybe Basics.Bool
, type_ : Maybe String
, axisLabel : Maybe AxisLabel
, 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 -> Json.Encode.Value

encode the xAxis option to Json.Encode.Value

YAxis Options


type alias YAxisOption =
{ show : Maybe Basics.Bool
, type_ : Maybe String
, axisLabel : Maybe AxisLabel
, 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 -> Json.Encode.Value

encode the yAxis option to Json.Encode.Value

Axis Label


type alias AxisLabel =
{ show : Maybe Basics.Bool
, inside : Maybe Basics.Bool
, rotate : Maybe Basics.Float
, margin : Maybe Basics.Float
, fontSize : Maybe Basics.Float
, padding : Maybe Basics.Float
, shadowBlur : Maybe Basics.Float
, shadowOffsetX : Maybe Basics.Float
, shadowOffsetY : Maybe Basics.Float 
}

describe the axisLabel

defaultAxisLabel : AxisLabel

create a axisLabel of for default value

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

encodeAxisLabel : AxisLabel -> Json.Encode.Value

encode the axisLabel option to Json.Encode.Value

Legend Attribute Values


type LegendAlignment
    = AutoLegendAlignment
    | LeftLegendAlignment
    | RightLegendAlignment

legend alignment value

Style Options


type alias LineStyleOption =
{ color : Maybe String
, width : Maybe Basics.Int
, type_ : Maybe LineStyleType
, shadowBlur : Maybe Basics.Int
, shadowColor : Maybe String
, shadowOffsetX : Maybe Basics.Int
, shadowOffsetY : Maybe Basics.Int
, opacity : Maybe Basics.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 -> Json.Encode.Value

encode the line style option to Json.Encode.Value


type alias CrossStyleOption =
{ color : Maybe String
, width : Maybe Basics.Int
, type_ : Maybe LineStyleType
, shadowBlur : Maybe Basics.Int
, shadowColor : Maybe String
, shadowOffsetX : Maybe Basics.Int
, shadowOffsetY : Maybe Basics.Int
, opacity : Maybe Basics.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 -> Json.Encode.Value

encode the cross style option to Json.Encode.Value


type alias ShadowStyleOption =
{ color : Maybe String
, shadowBlur : Maybe Basics.Int
, shadowColor : Maybe String
, shadowOffsetX : Maybe Basics.Int
, shadowOffsetY : Maybe Basics.Int
, opacity : Maybe Basics.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 -> Json.Encode.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 Basics.Float
, lineHeight : Maybe Basics.Float
, rich : Maybe RichOption 
}

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 -> Json.Encode.Value

encode the text style option to Json.Encode.Value

Style Attribute Values


type Orientation
    = Horizontal
    | Vertical

describe the orientation attribute

encodeOrientationValue : Orientation -> Json.Encode.Value

encode the orientation value to Json.Encode.Value


type HorizontalAlignment
    = Left
    | Center
    | Right

describe horizontal alignment: left, center, right

encodeHorizontalAlignmentValue : HorizontalAlignment -> Json.Encode.Value

encode the horizontal alignment value to Json.Encode.Value


type VerticalAlignment
    = Top
    | Middle
    | Bottom

describe vertical alignment: top, middle, bottom

encodeVerticalAlignmentValue : VerticalAlignment -> Json.Encode.Value

encode the vertical alignment value to Json.Encode.Value


type Spacing
    = Spacing Basics.Float
    | VHSpacing Basics.Float Basics.Float
    | FineSpacing Basics.Float Basics.Float Basics.Float Basics.Float

describe spacing setting

encodeSpacingValue : Spacing -> Json.Encode.Value

encode the spacing value to Json.Encode.Value


type SelectedMode
    = TrueSelectedMode
    | FalseSelectedMode
    | SingleSelectedMode
    | MultipleSelectedMode

describe the item selected mode

encodeSelectedModeValue : SelectedMode -> Json.Encode.Value

encode the selected mode value to Json.Encode.Value


type AnimationEasing
    = CubicOutAnimationEasing

describe the animation easing

encodeAnimationEasingValue : AnimationEasing -> Json.Encode.Value

encode the animation easing value to Json.Encode.Value


type LineStyleType
    = SolidLine
    | DashedLine
    | DottedLine

describe the line style type

encodeLineStyleTypeValue : LineStyleType -> Json.Encode.Value

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