μλ νμΈμ,
3.0μΌλ‘ μ κ·Έλ μ΄λ ν ν λ§λ μ°¨νΈμ λ§λκ° νμλμ§ μλ λ¬Έμ κ° μμ΅λλ€.
νλμ λ§λλ λ°μ΄ν°μ ν¬μΈνΈκ° νλλ§μλ κ²½μ°λ₯Ό νμν©λλ€. μ μ λ κ° μ΄μ μΆκ°νλ©΄ λ§λκ° νμλμ§ μμ΅λλ€.
μ΄κ²μ xaxisμ λ μ§κ°μμ λλ§ λ°μν©λλ€. λ°μ΄ν°λ₯Ό λ μ§μμ μ μλ‘ λ³κ²½νλ©΄ μ λλ‘ μλν©λλ€.
μ²¨λΆ λ μ€ν¬λ¦° μ·μ μ°Έμ‘°νμμμ€.
λ°μ΄ν° μνμ λ€μκ³Ό μ μ¬ν©λλ€.
{
"09/04/2012": "245",
"02/05/2013": "227",
"04/07/2013 ':"234 ",
"07/08/2015": "244",
"2016 λ
10 μ 11 μΌ": "2254"
}
κ°μ¬,
λ¨λ°
μλμμ λ³Ό μ μλ―μ΄ λ§λκ° μ ν 보μ΄μ§ μμ΅λκΉ? μ΄ μμΈμ 무μμ
λκΉ?
λꡬλ μ§ μ΄κ²μ λν ν΄κ²°μ±
μ΄ μμ΅λκΉ?
3.0μμ λ§λκ° λλ½ λ κ²μ΄ μ΄μν΄ λ³΄μ
λλ€. λ΄κ° μ νλ₯Ό λμΉκ±°λ 무μΈκ°λ₯Ό μ€μ νλ κ² κ°μ΅λλ€. μ΄μ λν ν΄κ²°μ±
μ΄ μλ€λ©΄ λ§€μ° λμμ΄ λ κ²μ
λλ€.
κ°μ¬,
λ¨λ°
μ΄λ»κ² μ€μ ν©λκΉ? μ°¨νΈ 3.0μ x μΆμ μ¬ μ€κ³νκΈ° λλ¬Έμ λ§μ κ²μ΄ λ³κ²½λμμ΅λλ€. μ½λλ₯Ό μ λ°μ΄νΈνμ§ μμΌλ©΄ λλ½λμμ μ μμ΅λλ€. μ§κΈμ ChartsDemoμμ λ€λ₯Έ λ§λ μ°¨νΈ λ°λͺ¨λ₯Ό νμΈνμμμ€.
λ°λͺ¨ μ°¨νΈλ₯Ό λ€μ μ€ννμ¬ λ¬Έμ λ₯Ό μ¬ν ν μ μλμ§ νμΈνμ§λ§ λ¬Έμ κ° μ΄λ¦° λ€λ₯Έ λ¬Έμ # 1716κ³Ό λΉμ·νλ€κ³ μκ°ν©λλ€.
λ³κ²½ μ¬νμ μ μ©νκ³ μ°¨νΈ λ°λͺ¨λ₯Ό μ€ννλ©΄ λ€μ μ°λ½ λλ¦¬κ² μ΅λλ€.
νΉμ x κ°μ΄ λ¬Έμ λ₯Ό μΌμΌν€λ κ² κ°μ΅λλ€.
κ°μ¬,
λ¨λ°
λλ κ°μ λ¬Έμ κ° μμ΅λλ€. λ΄ X μΆμ λ μ§λ₯Ό YYYY-MM-DD νμμΌλ‘ μ¬λ°λ₯΄κ² νμνμ§λ§ λ§λλ 보μ΄μ§ μμ΅λλ€.
@ liuxuan30 ,
μ¬κΈ° λ΄κ° κΈ°λ³Έμ μΌλ‘ μλν κ²μ
λλ€ ... 3.0μμ ChartsDemoλ₯Ό μ½κ° λ³κ²½νμΌλ©° μ νν λκ°μ μΌμνκ³ μμ΅λλ€ ...
λ€μκ³Ό κ°μ΄ λ³κ²½νμ΅λλ€. X κ°μ΄ λ λ°°μΈ λμ 1970 λ
μ΄ν λ μ§μ λ λ°° κ°μΈ datetimeμ μΆκ°ν©λλ€.
xaxis ν¬λ§·ν°λ₯Ό dd / MMμΌλ‘ λ³κ²½νμ΅λλ€.
λν BarChartViewController.mμ λν μ½λλ₯Ό 첨λΆνμ¬ νμΈν μ μμ΅λλ€.
μλ μ€ν¬λ¦° μ·μ μ°Έμ‘°νμμμ€.
λ§€μ° κ°λ¨ν κ²μ λμΉκ³ μκ±°λ μ΄κ²μ λ²κ·Έμ λλ€.
κ°μ¬,
λ¨λ°
μλ νμΈμ,μ΄ λ¬Έμ κ° μ μ’ κ²°λμλμ§ μ λͺ¨λ₯΄κ² μ§λ§ μ¬κΈ°μ https://github.com/danielgindi/Charts/issues/1716 μμ μ¦μμ μ€λͺ ν λͺ¨λ μ¬λκ³Ό λ§μ°¬κ°μ§λ‘ νλ‘μ νΈμμλ λμΌν λ²κ·Έκ° λ°μν©λλ€. μ컨λ, X μΆμ μκ° κ°κ²©κ³Ό κ°μ ν° κ°μ μ²λ¦¬ ν μμλ κ²μ²λΌ 보μ΄λ©° μ΄λ»κ² λ μ°¨νΈ λ λλ§μ μλ§μΌλ‘ λ§λλλ€.
@sjuvvalapalem μλ³Έ ChartsDemoκ° μ λλ‘ μλν©λκΉ? λλ λΉμ μ λ³νμ ββλν λ§₯λ½μ λͺ¨λ¦
λλ€. μ°¨νΈ 3.0μμ x κ°μ νμ λ λ°°μ
λλ€. λ³κ²½ ν μ¬νμ΄ μμΌλ©΄ λͺ¨λ κ΄λ ¨ νλλ₯Ό λ³κ²½νλμ§ νμΈνμμμ€. μ€ν¬λ¦° μ·μ λ§λκ° λλ½λμ΄ μμΌλ―λ‘ μμΈν λ΄μ©μ λ§λ μ°¨νΈ λ λλ¬μμ drawDataSets
μ (λ₯Ό) νμΈν μ μλ€κ³ μκ°ν©λλ€. μ¬μ©μ μΈ‘μμ λλ²κ·Ένλ κ²μ΄ λ μ½μ΅λλ€.
BarChartViewController.m.zip
@ liuxuan30 μ΄μ μ λ΅μ₯μμ λ³κ²½ ν λ΄μ©μ 첨λΆνμ΅λλ€.
λ΄κ° ν κ²μ μΌλΆ λ μ§μ λν΄ Nstimeintervalμ λ λ² μΆκ°νλ λμ μ΄λ€ μ΄μ λ‘ λ§λλ₯Ό νμνμ§ μλ κ²μ
λλ€.
λλ μ΄κ²μ΄ λ²κ·Έ μΌ μ μλ€κ³ μκ°νλ€. μ²¨λΆ λ zip λ¬Έμλ₯Ό 보μλ©΄ μ κ° λ³κ²½ ν λ΄μ©μ μ½κ² νμ
ν μ μμΌλ©° μ΄ν΄κ° λ κ²μ
λλ€.
λ€λ₯Έ μ¬λλ€μκ² λμΌν λ¬Έμ λ₯Ό μ΄ν΄λ³΄λ©΄ μ΄κ²μ΄ λ²κ·Έ μΌ μ μλ€κ³ μκ°ν©λλ€.
λ΄ νλ‘μ νΈκ° μ± μ€ν μ΄λ‘ νΈμλλ λμ μ€λ¨λκΈ° λλ¬Έμ μ΄μ λν λμμ ν¬κ² κ°μ¬λ립λλ€.
μ΄κ²μ λν ν΄κ²°μ± μ ν¬κ² λμμ΄ λ κ²μ λλ€.
κ°μ¬,
λ¨λ°
@ liuxuan30 μ΄ λ¬Έμ λ₯Ό
κ°μ¬,
λ¨λ°
μ΅κ·Όμ μΌμ΄ λ°λΉ μ λ무 빨리 λ³Ό μκ° μμ΄μ λ―Έμ ν΄μ. μλ ν κ²μ΄λ€
NSTimeIntervalμ λ΄κ° κΈ°μ΅νλ λ λ°°μ΄λ―λ‘ μν₯μ λ―ΈμΉμ§ μμμΌν©λλ€ ..
@ liuxuan30 λ€, μ΄μ€μ λλ€. ν¬λ§·ν°λ₯Ό μ¬μ©νλ©΄ λ μ§κ° μ¬λ°λ₯΄κ² νμλ©λλ€. λ§λ μμ κ°μ΄ μ¬λ°λ₯΄κ² νμλ©λλ€.
λͺ¨λ κ²μ΄ μλνμ§λ§ λ§λκ° νμλμ§ μμ΅λλ€.
λ°μ κ²½μ°μ΄ λ¬Έμ / λ²κ·Έλ₯Ό μ‘°μ¬ ν μμλ λ€λ₯Έ μ¬λμ΄ μμ΅λκΉ?
κ°μ¬,
λ¨λ°
μκ² μ΅λλ€. κ°λ¨ν νμΈνμ΅λλ€.
x μΆ λ²μλ
(lldb) po max - min
34041601.0
λ λλ§ ν λ barRect λλΉκ° λ무 μμ΅λλ€.
βΏ (30.7373051480045, 132.310035326087, 8.28906013339292e-06, 257.842777173913)
βΏ origin : (30.7373051480045, 132.310035326087)
- x : 30.7373051480045
- y : 132.310035326087
βΏ size : (8.28906013339292e-06, 257.842777173913)
- width : 8.28906013339292e-06 // <-- you won't see it
- height : 257.842777173913
κ·Έλμ λΉμ μ κ·Έκ²μ λ³΄μ§ λͺ»ν©λλ€.
κ·Έ μ΄μ λ x valμ΄ λ무 컀μ prepareBuffer()
μμ
let barWidthHalf = barData.barWidth / 2.0 // barWidthλ 0.9μ λλ€.
κ·Έλ
let left = CGFloat(x - barWidthHalf)
let right = CGFloat(x + barWidthHalf)
barRect.size.width = right - left
μ¬μν μΌμ λλ€.
@danielgindi λ ν° κ°μΉμ λμ²νκΈ° μν΄ barWidth
λ₯Ό μ²λ¦¬ν΄μΌνλ κ² κ°μ΅λλ€. λλ μ€κ³μ μν κ²μ
λλ€.
x λ²μλ λ§€μ° ν¬μ§ λ§ λͺ κ°μ λ§λμ λΆκ³Όνμ§λ§ νλ μ½λ© λ μ«μλ₯Ό μ¬μ©νμ¬ λ§λ λλΉλ₯Ό νμνλ―λ‘ λ¬Έμ κ° λ°μν©λλ€. λλ barWidthλ₯Ό "μ κ·ν"νλ €κ³ λ Έλ ₯νμ΅λλ€.
μμ ν΄κ²° λ°©λ²μ x κ°μ μ΄κ° μλ λ ν° μΌ λ¨μλ₯Ό μ¬μ©νλ κ²μ λλ€. λλ 1,2,3,4, ..λ‘ λ°κΎΈκ³ ν¬λ§·ν°κ° ν¬λ§·νλλ‘ν©λλ€. λ°μ΄ν°μμ x valsλ 1 λ μ΄μμ΄λ©°, μ¬μ§μ΄ λ©°μΉ λμμλ 365 λ§λμ΄κ³ λ§λλ μμ΅λλ€.
λ λ€λ₯Έ λ°©λ²μ κ°μΉ λ²μμ λ§κ² barWidth
λ₯Ό λ³κ²½νλ κ²μ
λλ€. κ·Έλ¬λ μ¬λ°λ₯Έ λ²νΈλ₯Ό μ°Ύλ λ°©λ²μ μμ§ λͺ
ννμ§ μμ΅λλ€.
μλ
νμΈμ,
λλ λκ°μ λ¬Έμ κ° μμ§λ§ ν΄κ²°μ±
μμ£Όμ§ μκ³ λ¬Έμ κ° λ«ν κ² κ°μ΅λλ€ ...
κΊΎμ μ ν μ°¨νΈλ₯Ό μ¬μ©νλ©΄ μ°¨νΈκ° μ λλ‘ κ·Έλ € μ§μ§λ§ μΈλ‘ λ§λ μ°¨νΈλ₯Ό μ ννλ©΄ λ§λκ° λνλμ§ μμ΅λλ€.
λμκ² κ·Έκ²μ κ°μ μ΄ μλλΌ λ²κ·Έμ
λλ€.
κ°μ¬
BarChartData.barWidthλ₯Ό ν° κ° (~ 10 000)μΌλ‘ μ€μ νλ©΄ λ¬Έμ κ° ν΄κ²°λμμ΅λλ€.
ν
λ리λ₯Ό μ€μ νμ¬μ΄ λ¬Έμ λ₯Ό ν΄κ²°νμ΅λλ€.
chartDataSet.barBorderColor = UIColor.blue
chartDataSet.barBorderWidth = 30
λμμ΄λλ ν¬λ§
barBorderWidthλ₯Ό μ€μ νλ©΄ λ¬Έμ κ° ν΄κ²°λλ κ² κ°μ΅λλ€.
μ΄ λ¬Έμ μ λν ν΄κ²°μ± μ΄ μμ΅λκΉ? barBorderWidth μ€μ μ μλνλ κ²μ²λΌ 보μ΄μ§λ§ λ°μ΄ν° ν¬μΈνΈκ° νλ λλ 2 κ°λΏμ΄λ©΄ μ μ΄ λ무 μκΈ° λλ¬Έμ μ λλ‘ μλνμ§ μμ΅λλ€ (barBorderWidthλ₯Ό 1λ‘ μ€μ νλ€κ³ κ°μ ). λ λμ μ«μλ‘ μ€μ νλ©΄ λͺ¨λ λ§λκ° κ²°ν©λκ³ μλ‘ μμ¬μ보기μ μ’μ§ μμ΅λλ€.
μ΄κ²μ λν λͺ¨λ μμ μ λλ¨ν κ°μ¬ν©λλ€.
맀λ ₯μ²λΌ μΌνμμμ€!
λ΄ λΆμ :
μ΄κ²μ λ²κ·Έμ
λλ€ ... long
λ°μ΄ν° μ νμ λ μ§ κ°μ 1542039314621μ΄λ©°, SimpleDateFormatμ μ¬μ©νμ¬ ν¬λ§· λ ν 2018 λ
11 μ 12 μΌμ μλ―Έν©λλ€. κ·Έλ¬λ x Axisλ λ¨Όμ long
κ°μ μ·¨νλ―λ‘ λ¬Έμ κ° λ°μν©λλ€. λ΄ μ루μ
μ xHelper, λμ ν° κ°μ μ
λ ₯νκ³ xHelperλ μμ μ μΌλ‘ μΉ΄μ΄ν° counter++
μ¬μ©νμ¬ μΈλ±μ€ long
λ°μ΄ν° μ νμ μννκ³ xValue μμ ν° long
κ°μ 보μ ν©λλ€. μ΄ μ½λλ 맀λ ₯μ²λΌ μλν©λλ€.
μ΄κ²μ μλͺ»λ μ½λμ λλ€.
String[] month = new String[] {"Jan", "Feb", "Mar", "Aprl"};
xAxis.setValueFormatter(new MyXAxisValueFormatter(month));
μ΄κ²μ μλͺ»λ μ½λμ λλ€.
xAxis.setValueFormatter(new IAxisValueFormatter() {
<strong i="20">@override</strong>
public String getFormattedValue (float value, AxisBase axis){
Date dates = new Date((long) value); //take your long value from BarEntry
SimpleDateFormat sdf = new SimpleDateFormat("dd/MM");
return sdf.format(dates);
}
}
μ΄κ²μ μλͺ»λ μ½λμ λλ€.
for (int i = 0; i < xValues.length; i++)
Date date = new Date(xValues[i]);
μ΄κ²μ μλͺ»λ μ½λμ λλ€.
List<Date> dates = new ArrayList<Date>();
for (int i = 0; i< xHelper.length; i++)
dates.add(new Date(xValues[i]));
μ΄ μ½λλ 맀λ ₯μ²λΌ μλν©λλ€.
SimpleDateFormat sdf = new SimpleDateFormat("dd/MM"); // as you seen on the picture
String[] xDates = new String[xHelper.length];
for (int m = 0; m < xHelper.length; m++)
xDates[m] = sdf.format(new Date(xValues[m]));
List<String> myDateList = new ArrayList<String>();
for (int n = 0; n < xHelper.length; n++)
myDateList.add(xDates[n]);
//convert your ArrayList into array
String[] month = (String[]) myDateList.toArray(new String[xHelper.length]);
xAxis.setValueFormatter(new YourXAxisValueFormatter(month));
μ΄κ²μ λ΄ μ 체 μ½λμ΄λ©° xValue λ° xHelperμ λν λͺ¨λ κ²μ μλ €μ€λλ€.
public class MyDatabaseHelper {
long xValue
int xHelper, yValues;
//empty constructor
public MyDatabaseHelper(){
}
//constructor
public MyDatabaseHelper(long xValue, int yValues, int xHelper){
this.xValue = xValue;
this.yValue = yValue;
this.xHelper = xHelper;
}
//Method
public long getxValue() {return xValues;}
public int getyValue() {return yValues;}
public int getxHelper() {return xHelper;}
}
λ€μμΌλ‘μ΄ μμ μ λ§λ€κ³ Phillip Jahodaμκ² κ°μ¬λ립λλ€.
public class MyXAxisValueFormatter implements IXAxisValueFormatter {
private String[] mValues;`
//constructor with array parameter
public MyAxisValueFormatter(String[] values) {
this.mValues = values;
}
<strong i="9">@override</strong>
public String getFormattedValue(float value, AxisBase axis) {
return mValues[(int) value];
}
}
λ§μ§λ§μΌλ‘ MainActivity ν΄λμ€λ₯Ό λ§λλλ€.
public class MainActivity extends AppCompatActivity {
EditText yInput;
Button buttonInsert;
FirebaseDatabase firebaseDatabase;
DatabaseReference reference;
BarChart barChart;
//this is xHelper as counter for indexing x values
int counter = 0;
<strong i="13">@override</strong>
protected void onCreate (Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
yInput = (EditText) findViewById(R.id.editText);
insertButton = (Button) findViewById(R.id.buttonInsert);
firebaseDatabase = FirebaseDatabase.getInstance();
reference = firebaseDatabase.getReference("ChartTable");
insert();
}
public void insert() {
buttonInsert.setOnClickListener(new View.OnClickListener() {
<strong i="14">@override</strong>
public void onClick (View v)
String id = reference.push().getKey();
long x = new Date().getTime(); //this is big value
int y = yInput.getText().toString();
// when you click button this counter increase
//note: using this counter will make your app being crash on 5 step Granularity
//my granularity is setGranularity(5);
//this is my problem and i don't know why. so, i have to make the counter start from zero
//like this
counter++
int c = counter - 1;
// input value into class
MyDatabaseHelper db = new MyDatabaseHelper(x, y, c);
//input method into Firebase Database
reference.child(id).setValue(db);
});
}
<strong i="15">@override</strong>
protected void onStart {
super.onStart();
reference.addValueEventListener(new ValueEventListener() {
<strong i="16">@override</strong>
public void onDataChange(<strong i="17">@NonNull</strong> DataSnapshot dataSnapshot) {
int count = (int) dataSnapshot.getChildrenCount();
long[] xValues = new long[count];
int[] yValues = new int[count];
int[] xHelper = new int[count];
int index = 0;
for (DataSnapshot myDataSnapshot : dataSnapshot.getChildren()){
MyDatabaseHelper db = myDataSnapshot.getValue(MyDatabaseHelper.class);
xValues[index] = db.getxValue();
yValues[index] = db.getyValue();
xHelper[index] = db.getxHelper();
index++
}
ArrayList<BarEntry> barEntry = new ArrayList<BarEntry>();
for (int i = 0; i < xHelper.length; i++)
barEntry.add(new BarEntry(xHelper[i], yValues[i]));
BarDataSet set1 = new BarDataSet(barEntry, "Project Progress");
set1.setColors(ColorTemplate.VORDIPLOM_COLORS);
set1.setDrawValues(false);
ArrayList<IBarDataSet> dataSets = new ArrayList<>();
dataSets.add(set1);
BarData data = new BarData(dataSets);
XAxis xAxis = barChart.getXAxis();
xAxis.setGranularity(5f);
xAxis.setPosition(XAxis.XAxisPosition.BOTTOM);
// input xValues[] into Date using List
SimpleDateFormat sdf = new SimpleDateFormat("dd/MM");
String[] xDates = new String[count];
for (int m =0; m < xValues.length; m++)
xDates[m] = sdf.format(new Date(xValues[m]));
List<String> xDatesList = new ArrayList<String>();
for (int n = 0; n < xDates.length; n++)
xDatesList.add(xDates[n]);
// you cannot insert xDatesList directly into setValueFormatter
//so convert ArrayList into array
String[] month = (String[]) xDatesList.toArray(new String[count]);
//finally
xAxis.setValueFormatter(new MyXAxisValueFormatter(month));
//done
barChart.getAxisRight().setEnabled(false);
barChart.setDragEnabled(true);
barChart.setScaleEnabled(true);
barChart.setPinchZoom(true);
barChart.setDoubleTapToZoomEnabled(false);
barChart.setDrawGridBackground(false);
barChart.setDragEnabled(true);
barChart.setData(data);
barChart.invalidate();
}
<strong i="18">@override</strong>
public void onCancelled(<strong i="19">@NonNull</strong> DatabaseError databaseError){
}
});
}
}
λͺ¨λ κ²μ΄ μλ£λμμ΅λλ€. κ·Έλ¦¬κ³ μ΄κ²μ λ΄ μ€λͺ μ λλ€.
μ΄ μ½λλ₯Ό μ¬μ©νμ§ μμ΅λλ€.
String[] month = new String[] {"Jan", "Feb", "Mar", "Aprl"};
xAxis.setValueFormatter(new MyXAxisValueFormatter(month));
λμ μ
λ ₯μ΄ νμνκ³ "jan", "feb"λ±μ μ°κ³ μΆμ§ μκΈ° λλ¬Έμ
λλ€. λ΄ μ루μ
:
String[] month = (String[]) myDateList.toArray(new String[xHelper.length]);
myDateList.toArray
μ¬μ©νλ©΄ ArrayListλ₯Ό κ°μ Έ μμ λ°°μ΄μ μ½μ
ν μ μμ΅λλ€.
κ·Έλ¦¬κ³ μ λμ΄ μ½λλ₯Ό μ¬μ©νμ§ μμ΅λλ€. μλνλ©΄->
xAxis.setValueFormatter(new IXAxisValueFormatter {
<strong i="15">@override</strong>
public String getFormattedValue(float value, AxisBase axis) {
Date dates = new Date((long) value)
SimpleDateFormat sdf = new SimpleDateFormat("dd/MM");
return sdf.format(dates);
}
}
λ§λκ° μ¬λΌμ§ x μΆμμ κ°μ Έμ¨ value
λλ¬Έμ
λλ€. λ΄ μ루μ
μ λ€μκ³Ό κ°μ΄ xHelper
.
ArrayList<BarEntry> barEntry = new ArrayList<BarEntry>();
for (int i=0; i<xHelper.length; i++)
barEntry.add(new BarEnry(xHelper[i], yValues[i]));
μμ μ xHelper
μΈλ±μ±μμν μμ κ°μ ν¬ν¨ν΄μΌνλ€λ κ²μ
λλ€. Date
κ·Έλ¦¬κ³ μ΄κ²μ΄ λΉλ°μ
λλ€.
λΉμ μ μ΄κ²μ μ¬μ©νμ¬ Date
λ₯Ό μ
λ ₯νμ§ μμ΅λλ€-> String[] month = new String[]{...};
κ·Έλ¬λ myDateList
String[] month = (String[]) myDateList.toArray(new String[xHelper.length]);
xAxis.setValueFormatter(new YourXAxisValueFormatter(month));
@sjuvvalapalem @avitusμ λν ν΄κ²°μ± μ
μ΄ λ²κ·Έκ°λ³΄κ³ λ μ§ 2 λ μ΄ μ§λ¬μ§ λ§ μμ§ μμ λμ§ μμμ΅λκΉ?
μ΄ λ¬Έμ λ₯Ό ν΄κ²°νκΈ° μν΄ PRμ μ μΆν μ μμ΅λκΉ? μλ added this to To do in 4.0 Release
λ‘ νμνμ΅λλ€.
μ΄κ²μ΄ λꡬμκ²λ λμμ΄λλμ§ νμ€νμ§ μμ§λ§ λμΌν λ¬Έμ κ° μμκ³ x μΆ λ²μμ λν΄ μ¬λ°λ₯Έ ν¬κΈ°λ‘ λ§λλ₯Ό μ€μ νμ¬ ν΄κ²°νμ΅λλ€.
let data = BarChartData(dataSets: [dataSet])
let dataSetRange = dataSet.xMax - dataSet.xMin
let availableSpacePerBar = dataSetRange / Double(dataSet.entryCount)
data.barWidth = availableSpacePerBar * 0.8 // 80% of available space
chartView.data = data
BarChartData.barWidthλ₯Ό ν° κ° (~ 10 000)μΌλ‘ μ€μ νλ©΄ λ¬Έμ κ° ν΄κ²°λμμ΅λλ€.
μ΄κ²μ λ°μ΄ν° λ²μ μ¬μ΄μ λλ½ λ κ°μ΄μμ λ https://github.com/danielgindi/Charts/issues/1742#issuecomment -519056482λ³΄λ€ λ μ μλν©λλ€. λΉ μ°μμ μ΄κ³ μ£ΌκΈ°μ μΈ λ°μ΄ν° μμ€.
κ·Έ μ¬μ΄μ λλ½ λ κ°μ΄μλ κ²½μ°
λκΈ https://github.com/danielgindi/Charts/issues/1742#issuecomment -519056482 λ€μ
BarChartData.barWidthλ₯Ό ν° κ° (~ 10 000)μΌλ‘ μ€μ νλ©΄ λ€μκ³Ό κ°μ΅λλ€.
κ·Έλ¬λ λ κ°μ§ λͺ¨λ μΆ©λΆν μ°μ κ°μ κ°μ§ λ νλ₯νκ² μλν©λλ€.
μ΄ λλ¬Έμ 3 μκ°μ μμμΌλ κ³μ μ£Όμνκ³ μμ΅λλ€. μΈλ±μ€λ₯Ό μ¬μ©νμ¬ λλ¬μ΅λλ€.
κ°μ₯ μ μ©ν λκΈ
μ΄κ²μ΄ λꡬμκ²λ λμμ΄λλμ§ νμ€νμ§ μμ§λ§ λμΌν λ¬Έμ κ° μμκ³ x μΆ λ²μμ λν΄ μ¬λ°λ₯Έ ν¬κΈ°λ‘ λ§λλ₯Ό μ€μ νμ¬ ν΄κ²°νμ΅λλ€.