diff --git a/chartspy/base.py b/chartspy/base.py index b161228..5ce017f 100644 --- a/chartspy/base.py +++ b/chartspy/base.py @@ -230,11 +230,10 @@ def json_type_convert(o: object): return o1.isoformat() elif isinstance(o, np.bool_): return bool(o) - elif isinstance(o, np.integer): + elif isinstance(o, (np.int_, np.intc, np.intp, np.int8, np.int16, np.int32, np.int64, + np.uint8, np.uint16, np.uint32, np.uint64)): return int(o) - elif isinstance(o, np.floating): - return float(o) - elif isinstance(o, np.complexfloating): + elif isinstance(o, (np.float_, np.float16, np.float32, np.float64,np.complexfloating)): return float(o) elif isinstance(o, np.character): return str(o) diff --git a/chartspy/express/echarts.py b/chartspy/express/echarts.py index 52936f5..71a4124 100644 --- a/chartspy/express/echarts.py +++ b/chartspy/express/echarts.py @@ -1565,7 +1565,7 @@ def mark_label_echarts(data_frame: pd.DataFrame, x: str, y: str, label: str, tit def mark_vertical_line_echarts(data_frame: pd.DataFrame, x: str, label: str, title="vertical_line", - label_position: str = 'middle', label_font_size: int = 10, label_distance: int = 10, + label_position: str = 'insideStartTop', label_font_size: int = 10, label_distance: int = 10, label_font_color: str = 'inherit',**kwargs): """ 在现有图表上叠加竖线,不能单独显示