2013年8月30日星期五

Android AChartEngine ( referred ACE) draw a histogram how to changethe column width ?

AChartEngine ( referred ACE) draw a histogram how to change the column width ? I painted pillars very fine ; following code , how to adjust ? ?
private void setChartSettings(XYMultipleSeriesRenderer renderer) {
         renderer.setChartTitle( "电视商城" );
         renderer.setXTitle( "x values" );
         renderer.setYTitle( "y values" );
         renderer.setBackgroundColor(Color.BLACK);
renderer.setApplyBackgroundColor(true);
renderer.setDisplayChartValues(true);
renderer.setXLabelsAngle(-15); // 设置 X 轴标签倾斜角度 (clockwise degree)
renderer.setXLabels(0); //设置 X 轴不显示数字(改用我们手动添加的文字标签)
for (int i = 0; i < titles.length ; i++){
        renderer.addTextLabel(i, titles[i]);
      }
         renderer.setMargins( new int [] {20, 30, 15, 0}); // 图形 4 边距
         renderer.setXAxisMin(0);
         renderer.setXAxisMax(8);
         renderer.setBarSpacing(0.1);
         renderer.setYAxisMin(1000);
         renderer.setYAxisMax(21000);
}




how to adjust the width of the histogram ? ? ?

In addition, there is a problem . . . How the X-axis is set to display the time ? ?


seeking advice ! ! !
------ Solution ---------------------------------------- ----
width I remember seemingly powerless , drawn is a view, you can like the picture as scaling. Ordinate change the time , I had to change, indeed forgotten ! On the word , huh, huh !
------ reference --------------------------------------- < br> how to change ah
------ reference ----------------------------------- ----
Well, I solved the problem , renderer.setBarSpacing (3.9); histogram allows thinner , whereas renderer.setBarSpacing (-3.9) allows histogram thicker. values ​​can set their own , but the positive and negative signs to right, and must have a decimal
------ reference ----------------------------- ----------
landlord I have met you this question ; I also set renderer.setBarSpacing (-3.9) is negative , but did not reach the desired effect . You can also set up that place yet ?

没有评论:

发表评论