Bar chart with data from columndatasource

Can a columndatasource be used to make a bar chart ?

I can’t find an example


Hi Arthur,

We are about to release version 0.10 which updates the charts API in a way that has been requested for a long time, namely to make it more "pandas dataframe" oriented. So with the new API, you can do,

  from bokeh.charts import Bar, output_file, show
  from bokeh.sampledata.autompg import autompg as df

  p = Bar(df, 'cyl', values='mpg', title="Total MPG by CYL")


You can actually see much better new charts docs here:

(These are the "dev" docs they will be deployed to the main docs URL after the release)

This doesn't quite answer your question, since you asked about ColumnDataSources. We should probably make Charts understand these as natively as we can, as well, but in the mean time, you can use the "to_df()" method of ColumnDataSource, something like:

  df = my_data_source.to_ds()
  p = Bar(df, 'foo', values='bar')

Hope that helps.



On Sep 23, 2015, at 2:00 PM, Arthur Dijkstra <[email protected]> wrote:

Can a columndatasource be used to make a bar chart ?
I can't find an example

You received this message because you are subscribed to the Google Groups "Bokeh Discussion - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
For more options, visit