Attributes for altering the view of your axis.
Adds classes to the container holding your axis.
myXAxis : Plot.Element msg
myXAxis =
Plot.xAxis
[ Axis.view
[ Axis.classes [ "axis--x" ] ]
]Adds styles to the axis line.
myXAxis : Plot.Element msg
myXAxis =
Plot.xAxis
[ Axis.view
[ Axis.line [ Line.stroke "blue" ] ]
]Position this axis to the lowest value on the opposite axis. E.g. if this attribute is added on an y-axis, it will be positioned to the left.
myXAxis : Plot.Element msg
myXAxis =
Plot.xAxis
[ Axis.view
[ Axis.positionLowest ]
]Position this axis to the highest value on the opposite axis. E.g. if this attribute is added on an y-axis, it will be positioned to the right.
myXAxis : Plot.Element msg
myXAxis =
Plot.xAxis
[ Axis.view
[ Axis.positionHighest ]
]Remove tick and value where the axis crosses the opposite axis.
myXAxis : Plot.Element msg
myXAxis =
Plot.xAxis
[ Axis.view [ Axis.cleanCrossings ] ]Anchor the ticks/labels on the inside of the plot. By default they are anchored on the outside.
myXAxis : Plot.Element msg
myXAxis =
Plot.xAxis
[ Axis.view
[ Axis.anchorInside ]
]By providing this attribute with a list of tick attributes, you may alter the values and ticks displayed as your axis' ticks.
myYAxis : Plot.Element msg
myYAxis =
Plot.yAxis
[ Axis.tick
[ Tick.view [ Tick.length 3 ] ]
, Axis.tickValues [ 2, 4, 6 ]
]Specify at what values will be added a tick.
myXAxis : Plot.Element msg
myXAxis =
Plot.xAxis
[ Axis.tickValues [ 0, 1, 2, 4, 8 ] ]Note: If you add another attribute altering the values like tickDelta after this attribute,
then this attribute will have no effect.
Specify what values will be added a tick by specifying the space between each tick.
myXAxis : Plot.Element msg
myXAxis =
Plot.xAxis
[ Axis.tickDelta 4 ]Note: If you add another attribute altering the values like tickValues after this attribute,
then this attribute will have no effect.
By providing this attribute with a list of label attributes, you may alter the values and ticks displayed as your axis' labels.
myYAxis : Plot.Element msg
myYAxis =
Plot.yAxis
[ Axis.label
[ Label.view
[ Label.displace (10, 0)
, Label.stroke "blue"
]
, Label.format (.value >> toString)
]
]Specify the values which you want a label for. If not specified, it will mirror the tick values.
myYAxis : Plot.Element msg
myYAxis =
Plot.yAxis
[ Axis.labelValues [ 0, 5, 10, 11 ] ]