Bokeh Wedge Angle related query

Hello Team,I wanted to know is there a way in which when we use bokeh wedge,we kickstart start angle from vertical insteadof horizantal level?

property type: AngleSpec

The angles to end the wedges, as measured from the horizontal.

I would like angles to have vertical axis as reference and not horizantal?


You could use a CustomJSTransform to add/subtract a fixed amount form angle values.

Hi Bryan, So say an example like this

p = figure(plot_height=350, title="Pie Chart", toolbar_location=None,
           tools="hover", tooltips="@country: @value", x_range=(-0.5, 1.0))
p.wedge(x=0, y=1, radius=0.4,
        start_angle=cumsum('angle', include_zero=True), end_angle=cumsum('angle'),
        line_color="white", fill_color='color', legend='country', source=data)


The start and end angles always start from 0 degree - I would like to start from 90 degree.
Is there an example which you have - very new to pie charting of bokeh?


@harshshekhar I don’t have any example to share that measures starting from a different axis. Using a CustomJSTransform is just a suggestion of something that might potentially be useful, based on your initial post. However, seeing your further code with cumsum, I think the best option is really just to convert your data to the format Bokeh expects. I’m not aware of a good way to combine cumsum with CustomJSTransform. Every plotting library will have various conventions that you simply will just have to adapt to, “wedge angles measured from horizontal” is one such convention for Bokeh.

got it-let me try it.thank you

1 Like