我正在与Zeppelin合作以创建一些图表,我正在python中使用Nvd3来可视化数据框。我想可视化离散的BarChart,它可以工作,但对于每个条,它在x_axis和y轴上的标签显示十进制而不是整数{105.00,1.00,0.00},它显示整数105,1,0。 o如何配置图表以将条形图上显示的值转换为整数
import pandas as pd
from zeppelin_viz.nvd3 import Nvd3
from zeppelin_viz.nvd3.nvd3_chart import Nvd3Chart
nv = Nvd3()
nv.reloadNVD3("1.8.5")
df_type=pd.DataFrame()
df_type['Plage_Valeur'] = [-11,
-12, -13, -14, -15, -16, -17, -18, -19, -20,
-21, -22, -23, -24, -25, -26, -27,-28, -29, -30,
-31, -32, -33, -34, -35, -36 , -37, -38 , -39,
-40 ]
df_type['valOntrx']=t_valOntrx #t_valOntrx is list of value same lenght of Plage_Valeur
df_type=df_typeONU.sort_values(['Plage_Valeur'], ascending=[1]).reset_index()
db = nv.discreteBarChart()
config={"height": 850, "width": 2000, "color": nv.c20(), "staggerLabels": True, "xAxis":{"axisLabel":"OLTRX 1db pas", "tickFormat":"d"},
"yAxis":{"axisLabel":"count", "tickFormat":",f"}}
data = db.convert(df_typeONU, key="Plage_Valeur", value="valOntrx")
如何将条形图顶部的值转换为整数? 请帮忙!