Java MPAndroidChart条内标签 我使用的是水平图,我想在酒吧里面或中间画一个标签(卖主的名字),在BARDASET中有一个叫做St贴标签的东西,但是它不起作用。 这是我的密码: private BarDataSet createLineChart(String storeName, List<String> listofcompanies){ ArrayList<BarEntry> entries= new ArrayList<BarEntry>(); for (int j = 0; j < listofcompanies.size(); j++) { entries.add(new BarEntry(Float.parseFloat(listofcompanies.get(j)),j)); } Random rd = new Random(); setComp1 = new BarDataSet(entries,storeName); setComp1.setColor(Color.argb(255,rd.nextInt(256),rd.nextInt(256),rd.nextInt(256))); setComp1.setDrawValues(true); setComp1.setLabel(storeName); setComp1.setHighlightEnabled(true); setComp1.setDrawValues(true); // LineData data =new LineData(labels,dataset); return setComp1; } private BarDataSet createLineChart(字符串storeName,公司列表){ ArrayList条目=新的ArrayList(); 对于(int j=0;j
尝试使用:Java MPAndroidChart条内标签 我使用的是水平图,我想在酒吧里面或中间画一个标签(卖主的名字),在BARDASET中有一个叫做St贴标签的东西,但是它不起作用。 这是我的密码: private BarDataSet createLineChart(String storeName, List<String> listofcompanies){ ArrayList<BarEntry> entries= new ArrayList<BarEntry>(); for (int j = 0; j < listofcompanies.size(); j++) { entries.add(new BarEntry(Float.parseFloat(listofcompanies.get(j)),j)); } Random rd = new Random(); setComp1 = new BarDataSet(entries,storeName); setComp1.setColor(Color.argb(255,rd.nextInt(256),rd.nextInt(256),rd.nextInt(256))); setComp1.setDrawValues(true); setComp1.setLabel(storeName); setComp1.setHighlightEnabled(true); setComp1.setDrawValues(true); // LineData data =new LineData(labels,dataset); return setComp1; } private BarDataSet createLineChart(字符串storeName,公司列表){ ArrayList条目=新的ArrayList(); 对于(int j=0;j,java,android,mpandroidchart,Java,Android,Mpandroidchart,尝试使用: chart.getXAxis().setPosition(XAxisPosition.BOTTOM_INSIDE); 或 这将解决您的问题。尝试使用: chart.getXAxis().setPosition(XAxisPosition.BOTTOM_INSIDE); 或 这将解决您的问题。
chart.getXAxis().setPosition(XAxisPosition.BOTTOM_INSIDE);
或
这将解决您的问题。尝试使用:
chart.getXAxis().setPosition(XAxisPosition.BOTTOM_INSIDE);
或
这将解决您的问题。