Source = ColumnDataSource(data=dict(x=a_list, y=an_array)) Or, put all data in a ColumnDataSource and pass column names: Supplying a user-defined data source AND iterable values to glyph methods is P.add_tools(HoverTool(tooltips=[("Audience", " ("Impressions", " = None P.vbar(x=bokeh_bar, top="Impressions", width=0.9, color='color', P = figure(x_range=list(bokeh_bar), plot_height=250, title="Impressions by Audience", Source = ColumnDataSource(data=dict(audience=bokeh_bar, I have been reading over the documentation and applying the plotting API syntax (based on the documentation you sent) to my problem (which worked perfectly using version 0.12.02) however, when I upgraded to 0.12.16, I get the following error.īokeh_bar = df.groupby(, as_index=False).sum() On May 22, 2018, at 18:57, Adrian Ciconte wrote: The solution is to put the "x" values in your CDS as well. If you use a "source" arg at all, then all values need to be in the CDS source, as the error states. You are sending a literal list or array as the "x" value:īut then sending other values as columns from a CDS source: To view this discussion on the web visit \. To unsubscribe from this group and stop receiving emails from it, send an email to. You received this message because you are subscribed to the Google Groups "Bokeh Discussion - Public" group. To quickly convert: df = df.apply(lambda x: str(x).replace(':','-')) NOTE: if you try and replicate this, dates for Bokeh can't be in DateTime format only strings. P.add_tools(HoverTool(tooltips=[("Link_Clicks", " " = 45 Line_color="white", plot_width=900, plot_height=400, bar_width=0.9, legend=None, toolbar_location="right") P = Bar(bar_df, label=bar_df.index, values="Link_Clicks", width=1, source=source, agg='sum', I am trying to visualise this using Bokeh which I've managed to do successfully, however when implementing the hover-tool, it returns the number divided specifically by 2. On May 22, 2018, at 08:02, Adrian Ciconte wrote: Instead, use the well-supported otting API, which has had very significant improvements to make all kinds o bar charts much simpler (the otting API is now more capable than ever was): It is currently completely unmaintained and unsupported. It was a failed experiment, and was deprcated and subsequently removed entirely last year. I have tried multiplying y*2 under ColumnDataSource and within the Hover Tool, but still no luck.ĭon't use bokeh.charts (including Bar) for anything. When hovering over, you can see this is divided perfectly by 2 which is strange. To quickly convert: df = df.apply(lambda x: str(x).replace(’:’,’-’)) NOTE: if you try and replicate this, dates for Bokeh can’t be in DateTime format only strings. P.add_tools(HoverTool(tooltips=[(“Link_Clicks”, “ “ = 45 Line_color=“white”, plot_width=900, plot_height=400, bar_width=0.9, legend=None, toolbar_location=“right”) P = Bar(bar_df, label=bar_df.index, values=“Link_Clicks”, width=1, source=source, agg=‘sum’, Is this a bug?įrom bokeh.io import output_notebook, show, push_notebookįrom bokeh.io import output_file, show, curdocįrom otting import figure, ColumnDataSourceįrom bokeh.models import HoverTool, DatetimeTickFormatter, DataRange1d, CustomJS, Plot, LinearAxis, Gridįrom bokeh.charts import Bar, BoxPlot, Donut, HeatMap, Histogram, Line, Scatter, TimeSeries I am trying to visualise this using Bokeh which I’ve managed to do successfully, however when implementing the hover-tool, it returns the number divided specifically by 2.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |