marianogappa/chart

Could not construct chart because [Couldn't find values to plot.]

Closed this issue · 4 comments

I get the error in the title when passing the following input to the chart program

0       1
2       463008

@jamesk this actually works on scatter plots and line charts. You probably tried either a pie chart or a bar chart.

The reason it doesn't render a chart is because those two are expecting at least one string column, given that pie and bar charts always have one "discrete dimension" (as opposed to "continuous"), and these two floats are by default interpreted as continuous.

e.g. On a poll results pie chart with data:

Yes	0.46
No	0.54

Yes/No is the "discrete dimension"

Given:

t -> time
f -> float
s -> string

A proposed sensible default (in the case there are no s columns) could be:

  • If there is a t column and also an f column, use the tcolumn as the discrete dimension
  • If there are 2 f columns, use the 1st f column as the discrete dimension (your case)

I'll start implementing it. Let me know what you think.

@jamesk could you go get -u github.com/marianogappa/chart and try again? It should work now.

In addition, bar and pie charts should now support time columns and additional sensible defaults.

Cool, working now, thanks!

I'll add a comment when I release the fix. It'll be a patch version bump.