holoviz / holoviews

With Holoviews, your data visualizes itself.
https://holoviews.org
BSD 3-Clause "New" or "Revised" License
2.71k stars 403 forks source link

Feature request candlestick plots #3627

Open ahuang11 opened 5 years ago

ahuang11 commented 5 years ago

New hv element https://bokeh.pydata.org/en/latest/docs/gallery/candlestick.html

Or maybe simply let users input the min, 25, 75, max into hv.BoxWhisker and that would be a candlestick?

Or stacking errorbars and have an opt to swap between a rectangular bar vs line http://holoviews.org/reference/elements/bokeh/ErrorBars.html#bokeh-gallery-errorbars

poplarShift commented 5 years ago

I think as a first step it would be worthwhile to put the individual components and their associated plotting code of a BoxWhisker into separate elements/functions. Currently, a BoxWhisker does the calculation of all the boxes (VBar or HBar) and the whiskers (as Segment) in one go.

Would it make sense to split this up into utils

  1. data_to_quantiles (backend-agnostic)
  2. quantiles_to_bokeh_element (for bokeh, say)
    1. quantiles_to_whiskers
    2. quantiles_to_bar ...

and then for the individual elements (such as BoxWhisker) compose the outputs of number 2.?

ahuang11 commented 5 years ago

That sounds like a good plan

ahuang11 commented 5 years ago

For bokeh specifically, I'm imagining BoxWhisker inherits from CandleStick?

the util functions: _draw_segments, _draw_bars, _draw_points CandleStick is segments + bars which accepts a lower, upper, "q1" and "q3" BoxWhisker is segments + bars + median point + outlier points which accepts a lower, upper, q1, q2, q3 (or automatically compute it from data if 5 vdims aren't provided?)

dofine commented 4 years ago

any progress on this, plz?

ahuang11 commented 4 years ago

No update from me