@@ -102,6 +102,21 @@ def _valid_update_width_kwargs():
102102
103103 return vkwargs
104104
105+ def _scale_width_config (scale ,width_config ):
106+ if scale ['volume' ] is not None :
107+ width_config ['volume_width' ] *= scale ['volume' ]
108+ if scale ['ohlc' ] is not None :
109+ width_config ['ohlc_ticksize' ] *= scale ['ohlc' ]
110+ if scale ['candle' ] is not None :
111+ width_config ['candle_width' ] *= scale ['candle' ]
112+ if scale ['lines' ] is not None :
113+ width_config ['line_width' ] *= scale ['lines' ]
114+ if scale ['volume_linewidth' ] is not None :
115+ width_config ['volume_linewidth' ] *= scale ['volume_linewidth' ]
116+ if scale ['ohlc_linewidth' ] is not None :
117+ width_config ['ohlc_linewidth' ] *= scale ['ohlc_linewidth' ]
118+ if scale ['candle_linewidth' ] is not None :
119+ width_config ['candle_linewidth' ] *= scale ['candle_linewidth' ]
105120
106121def _determine_width_config ( xdates , config ):
107122 '''
@@ -138,23 +153,13 @@ def _determine_width_config( xdates, config ):
138153 width_config ['candle_linewidth' ] = _dfinterpolate (_widths ,datalen ,'clw' )
139154 width_config ['line_width' ] = _dfinterpolate (_widths ,datalen ,'lw' )
140155
141- if config ['scale_width_adjustment' ] is not None :
156+ if 'scale_width_adjustment' in config ['style' ]:
157+ scale = _process_kwargs (config ['style' ]['scale_width_adjustment' ],_valid_scale_width_kwargs ())
158+ _scale_width_config (scale ,width_config )
142159
160+ if config ['scale_width_adjustment' ] is not None :
143161 scale = _process_kwargs (config ['scale_width_adjustment' ],_valid_scale_width_kwargs ())
144- if scale ['volume' ] is not None :
145- width_config ['volume_width' ] *= scale ['volume' ]
146- if scale ['ohlc' ] is not None :
147- width_config ['ohlc_ticksize' ] *= scale ['ohlc' ]
148- if scale ['candle' ] is not None :
149- width_config ['candle_width' ] *= scale ['candle' ]
150- if scale ['lines' ] is not None :
151- width_config ['line_width' ] *= scale ['lines' ]
152- if scale ['volume_linewidth' ] is not None :
153- width_config ['volume_linewidth' ] *= scale ['volume_linewidth' ]
154- if scale ['ohlc_linewidth' ] is not None :
155- width_config ['ohlc_linewidth' ] *= scale ['ohlc_linewidth' ]
156- if scale ['candle_linewidth' ] is not None :
157- width_config ['candle_linewidth' ] *= scale ['candle_linewidth' ]
162+ _scale_width_config (scale ,width_config )
158163
159164 if config ['update_width_config' ] is not None :
160165
0 commit comments