-
Notifications
You must be signed in to change notification settings - Fork 87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dumbbell plot #418
Comments
I am having a look at this one! |
Hey @Lewiszz. Are you still planning to finish this? If not, I would greatly appreciate if you could link what you ended up with during the hackathon (e.g. a script or notebook you worked in) so others can use it as a foundation to tackle this chart. If also do not have anything to link, no worries, please just tell me that this issue is up-for-grabs again. Thanks ❤️ |
Hey @kMutagene! Sorry, forgot to post it here, but I didn't get anywhere worth sharing and I also think there are other libraries (or issues) where I can contribute in a more productive way. This was a bit too far out of my comfort zone :) So yes, open for anyone to pick up! Thanks for giving me the opportunity to try though. |
This is either achievable by creating one trace per pair, or one trace per group. I settled in implementing one trace per group, as that enables way more useful legends. However, now the lines have to been drawn as shapes, and correct shape layer Meanwhile, here is simple way to achieve this: let group1 = [1; 2; 3; 6]
let group2 = [3; 1; 4; 1]
let labels = ["A"; "B"; "C"; "D"]
[
Chart.Point(
labels,
group1,
Name = "Group 1",
Marker = Marker.init(Size = 20)
)
Chart.Point(
labels,
group2,
Name = "Group 2",
Marker = Marker.init(Size = 20, Color = Color.fromString "red")
)
]
|> Chart.combine
|> Chart.withShapes (
Seq.zip3 labels group1 group2
|> Seq.map (fun (label, y1, y2) ->
Shape.init(
ShapeType = StyleParam.ShapeType.Line,
X0 = label,
X1 = label,
Y0 = y1,
Y1 = y2
)
)
) note that there is no way to place the markers above the lines pre 2.31. |
Description
Dumbbell plot [1] (also known as Dumbbell chart, Connected dot plot) is great for displaying changes between two points in time, two conditions or differences between two groups.
Example:
Pointers
#IConvertible
for data input, as this allows forstring
s, number types such asint
andfloat
, andDateTime
.References
Hints (click to expand if you need additional pointers)
Chart.Range
The text was updated successfully, but these errors were encountered: