- Mchart = (Linechart) Findviewbyid (R.ID.CHART1);
- Mchart.setdescription (""); //Set Chart description information
- Mchart.setscaleenabled (false); //Set whether the chart can be scaled
- Mchart.setbackgroundcolor (Color.White); //Set chart background color
- Mchart.setdrawgridbackground (false); //Set whether the table is displayed
- Xaxis Xaxis = Mchart.getxaxis (); //Get the X-axis instance of the chart
- Xaxis.setposition (Xaxisposition.bottom); //Set the x-axis display position
- Xaxis.setdrawgridlines (false); //Set whether to display the X-axis table
- Xaxis.setavoidfirstlastclipping (true); //Set X-axis start and end point label does not exceed screen
- Xaxis.setdrawaxisline (true); //Set display x-axis
- Xaxis.setspacebetweenlabels (0); //Set X axis label not spaced
- YAxis Leftaxis = Mchart.getaxisleft (); //Get the left y-axis instance of the chart
- Leftaxis.setaxismaxvalue (3.4482f); //Set y-axis maximum value
- Leftaxis.setaxisminvalue (3.1872f); Sets the y-axis minimum value.
- Leftaxis.setstartatzero (false); //Set chart starting point starting from 0
- Leftaxis.enablegriddashedline (10f, 10f, 0f); //Set the horizontal table to be dashed
Bardataset Set1 = new Bardataset (YVALS1, NULL);
Set1.setbarspacepercent (0f);//May be considered to set the thickness between the pillars, the larger the number, the distance between the pillars is large
mpchartandroid-Column Chart