【发布时间】:2014-08-16 12:09:46
【问题描述】:
在我的应用程序中,我使用 BarChart 库来绘制绘图。我在应用程序操作期间动态创建 BarModels。
这里是负责创建图表的代码:
void tworzWykres(int ilosc){
List<float> listImport = getHistoricalRates (wykresWybor,ilosc);
if (listImport.Count == 0) {
Toast.MakeText (this, "Brak notowań dla tej waluty!", ToastLength.Short).Show ();
}
else if (ilosc > listImport.Count) {
Toast.MakeText (this, "Zmniejsz ilość notowań", ToastLength.Short).Show ();
} else {
BarModel[] data = new BarModel[listImport.Count];
for (int i = 0; i < listImport.Count; i++) {
data [i] = new BarModel() { Value = listImport [i], Legend = daty[i]};
}
chart = FindViewById<BarChartView> (Resource.Id.barChart);
chart.ItemsSource = data;
chart.Invalidate ();
}
我在 Click 事件中为我的 Button 调用该方法。 单击按钮后,仅显示网格和轴 - 隐藏条形, 但是当我单击图表区域上的一些编辑文本和键盘重叠时,会出现条形图。 我是Android编程新手,我不知道如何解决这个问题。我希望在单击按钮后立即出现条形图。 我希望你知道如何解决这个问题:)
【问题讨论】:
标签: android xamarin refresh bar-chart redraw