The intersection is where your two axis lines meet. By default this is at the smallest coordinate possible (the downmost left corner), but it need not be as illustated below.
Internal.Axis.Intersection.Config
Use in the LineChart.Config
passed to LineChart.viewCustom
.
chartConfig : LineChart.Config Data msg
chartConfig =
{ ...
, intersection = Intersection.default
, ...
}
default : Config
Sets the intersection at the minimum on both the range and domain.
intersectionConfig : Intersection.Config
intersectionConfig =
Intersection.default
See the full example here.
atOrigin : Config
Sets the intersection as close to the origin as your range and domain allows.
intersectionConfig : Intersection.Config
intersectionConfig =
Intersection.atOrigin
See the full example here.
at : Basics.Float -> Basics.Float -> Config
Sets the intersection to your chosen x and y respectivily.
intersectionConfig : Intersection.Config
intersectionConfig =
Intersection.at 0 3
See the full example here.
custom : (LineChart.Coordinate.Range -> Basics.Float) -> (LineChart.Coordinate.Range -> Basics.Float) -> Config
Sets the intersection to your chosen x and y, given the range and domain respectivily.
intersectionConfig : Intersection.Config
intersectionConfig =
Intersection.custom .min middle
middle : Coordinate.Range -> Float
middle { min, max } =
min + (max - min) / 2
See the full example here.