I asked this question a few weeks ago about making a graph like this in Python, and got a couple ideas from the answer there. Basically, I'm trying to make a interactive web chart. It's supposed to be a bunch of points connected by line segments (a connected scatterplot, of sorts). Each point has two corresponding axes labels - one that's a box with some text, and one below that which has a number (this number is also what is plotted in that "column" on the chart)
I decided on trying to make my plot using the Python library Bokeh. Here's where I'm at so far:
import bokeh.io
from bokeh.resources import INLINE
from bokeh.embed import components
from bokeh.models.tools import HoverTool
from bokeh.models import CategoricalAxis, FactorRange
from bokeh.plotting import figure, output_file, show, output_notebook
x = ['label1', 'label2', 'label3', 'label4', 'label5', 'label6', 'label7', 'label8']
y = [1.1, 2.2, 1.8, 4.0, 1.0, 2.8, 3.6, 1.7]
p = figure(x_range=[*x], y_range=(0, 5), plot_height=500)
# dotted line graph is constructed of a circle glyph and a line glyph together
dots = p.circle(x=x, y=y, color='black', size=10)
line = p.line(x=x, y=y, color='black')
numbers = ['1.1', '2.2', '1.8', '4.0', '1.0', '2.8', '3.6', '1.7']
p.extra_x_ranges = {"extra_numbers": FactorRange(factors=numbers)}
p.add_layout(CategoricalAxis(x_range_name="extra_numbers"), 'below')
p.toolbar.logo = None
show(p)
My apologies about the image resolution.
As you can see, the actual plot is a pretty good approximation of what I was aiming for, but the axes don't look good at all. Unfortunately, it seems like multi-line axes support is pretty hard in Bokeh, and the difficulty in adding styling to the two x-axes is making me think I should switch my approach.
I see three possibilities moving forward:
Try to create a template of the graph in JS, and add the plot into that template. In other words, create the bottom two rows of boxes and the y-axis legend in JS, create a connected scatterplot in Bokeh, and place that scatterplot into the JS template.
Recreate this chart in a JS plotting library, like D3.js. This seems like the best long-term solution.
Try to figure it out in Bokeh or some other Python library (I'm a pretty inexperienced dev, but this doesn't seem like it's gonna happen).
I am not super familiar with JS - it'd be great if someone could give me some skeleton code for what this might look like if JavaScript is needed. Any suggestions or ideas would be greatly appreciated.
