pyxley
pyxley copied to clipboard
Line Plot not plotting properly
I've used the examples to plot, but just changed the data source its picking from (another csv) and there's no way my data should ever plot like this. Is there a fix or is there something I'm missing?
yikes, maybe there's an ordering issue?
@nmkridler I don't think so, but is there any documentation on how the LineChart function works and the parameters that it works with?
Like what does this do and what are the parameters?
LineChart(df, fig, "segment", ["value"], init_params={"Data": "Steps"})
I need to revisit a chunk of the documentation, but this should still be applicable: pxyley.charts.mg.line_chart
"segment"
is the x-axis column name, ["value"]
is a list of columns to plot on the y-axis. init_params
will filter the dataframe where "Data" == "Steps"
.
@nmkridler the datapoints that highlight on hover are sequential, but its the in-betweens are really going for a twirl. Is there an aspect of the plot that I can control the "curvy-ness" of the graph?
The wrapper I wrote is really simple, but it can be extended to pass arbitrary options. In the next version, I can make it possible to pass additional options such as the ones listed in their documentation.
I tried to override the options that get sent to the JavaScript bundle, but it looks like I have some sort of version mismatch. The only way to get around this is to build your own bundle. The tests folder can be used as an example, but I don't think it's very straightforward. Have you tried the plotly line plot?
Yes I've run all the examples and I'm using metricgraphics as a boilerplate. There are no problems with ordering of the x axis, its seems to be some stylistic function that's curving it a bit too much and unnecessarily
After metrics-graphics 2.10, the interpolate
option takes a function, so there's no way to change it without rebuilding the JavaScript bundle. The tests
directory shows how to point to a different bundle, but building the JS bundle is not straightforward. I'll put this on the list of things to change for the next version.