pyxley icon indicating copy to clipboard operation
pyxley copied to clipboard

Line Plot not plotting properly

Open RohitJacob opened this issue 7 years ago • 7 comments

screen shot 2017-05-08 at 10 40 45 am

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?

RohitJacob avatar May 08 '17 18:05 RohitJacob

yikes, maybe there's an ordering issue?

nmkridler avatar May 08 '17 18:05 nmkridler

@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"})

RohitJacob avatar May 08 '17 18:05 RohitJacob

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 avatar May 08 '17 18:05 nmkridler

@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?

RohitJacob avatar May 08 '17 19:05 RohitJacob

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?

nmkridler avatar May 08 '17 20:05 nmkridler

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

RohitJacob avatar May 08 '17 23:05 RohitJacob

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.

nmkridler avatar May 09 '17 00:05 nmkridler