Skip to content

Commit

Permalink
Trait labels added
Browse files Browse the repository at this point in the history
  • Loading branch information
exotic123567 committed Sep 16, 2024
1 parent 7b117d2 commit 3b61154
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import com.github.mikephil.charting.charts.BarChart
import com.github.mikephil.charting.data.BarData
import com.github.mikephil.charting.data.BarDataSet
import com.github.mikephil.charting.data.BarEntry
import com.github.mikephil.charting.formatter.IndexAxisValueFormatter

// TODO: Rename parameter arguments, choose names that match
// the fragment initialization parameters, e.g. ARG_ITEM_NUMBER
Expand Down Expand Up @@ -95,6 +96,10 @@ class AgreeablenessFragment : Fragment() {
dataEntriesExtroversion.reverse()
labelsExtroversion.reverse()

val labels = mutableListOf("AGREEABLENESS",
"Trust", "Morality", "Altruism", "Cooperation", "Modesty", "Sympathy"
)

val barDataSetExtroversion = BarDataSet(dataEntriesExtroversion, "Agreeableness Traits")
barDataSetExtroversion.setValueTextColor(color) // Set text color
barDataSetExtroversion.setColors(color) // Set bar color
Expand All @@ -109,7 +114,9 @@ class AgreeablenessFragment : Fragment() {
extrachart.data = barDataExtroversion
extrachart.invalidate()
extrachart.setDrawBorders(false)
extrachart.xAxis.isEnabled = false
val xAxis = extrachart.xAxis
xAxis.valueFormatter = IndexAxisValueFormatter(labels)
//extrachart.xAxis.isEnabled = false
extrachart.axisLeft.isEnabled = false
extrachart.axisRight.isEnabled = false
extrachart.description.isEnabled = false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import com.github.mikephil.charting.charts.BarChart
import com.github.mikephil.charting.data.BarData
import com.github.mikephil.charting.data.BarDataSet
import com.github.mikephil.charting.data.BarEntry
import com.github.mikephil.charting.formatter.IndexAxisValueFormatter

// TODO: Rename parameter arguments, choose names that match
// the fragment initialization parameters, e.g. ARG_ITEM_NUMBER
Expand Down Expand Up @@ -101,6 +102,11 @@ class ConscientiousnessFragment : Fragment() {
dataEntriesExtroversion.reverse()
labelsExtroversion.reverse()

val labels = mutableListOf("CONSCIENTIOUSNESS",
"Self-Efficacy",
"Orderliness", "Dutifulness", "Achievement-Striving", "Self-Discipline", "Cautiousness"
)

val barDataSetExtroversion = BarDataSet(dataEntriesExtroversion, "Conscientiousness Traits")
barDataSetExtroversion.setValueTextColor(color) // Set text color
barDataSetExtroversion.setColors(color) // Set bar color
Expand All @@ -109,7 +115,9 @@ class ConscientiousnessFragment : Fragment() {
extrachart.data = barDataExtroversion
extrachart.invalidate()
extrachart.setDrawBorders(false)
extrachart.xAxis.isEnabled = false
val xAxis = extrachart.xAxis
xAxis.valueFormatter = IndexAxisValueFormatter(labels)
//extrachart.xAxis.isEnabled = false
extrachart.axisLeft.isEnabled = false
extrachart.axisRight.isEnabled = false
extrachart.description.isEnabled = false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import com.github.mikephil.charting.charts.BarChart
import com.github.mikephil.charting.data.BarData
import com.github.mikephil.charting.data.BarDataSet
import com.github.mikephil.charting.data.BarEntry
import com.github.mikephil.charting.formatter.IndexAxisValueFormatter

// TODO: Rename parameter arguments, choose names that match
// the fragment initialization parameters, e.g. ARG_ITEM_NUMBER
Expand Down Expand Up @@ -99,6 +100,12 @@ class ExtroversionFragment : Fragment() {
dataEntriesExtroversion.reverse()
labelsExtroversion.reverse()

val labels = mutableListOf("EXTRAVERSION",
"Friendliness",
"Gregariousness",
"Assertiveness", "Activity Level", "Excitement-Seeking", "Cheerfulness"
)

val barDataSetExtroversion = BarDataSet(dataEntriesExtroversion, "Extraversion Traits")
barDataSetExtroversion.setValueTextColor(color) // Set text color
barDataSetExtroversion.setColors(color) // Set bar color
Expand All @@ -113,7 +120,9 @@ class ExtroversionFragment : Fragment() {
extrachart.data = barDataExtroversion
extrachart.invalidate()
extrachart.setDrawBorders(false)
extrachart.xAxis.isEnabled = false
val xAxis = extrachart.xAxis
xAxis.valueFormatter = IndexAxisValueFormatter(labels)
//extrachart.xAxis.isEnabled = false
extrachart.axisLeft.isEnabled = false
extrachart.axisRight.isEnabled = false
extrachart.description.isEnabled = false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import com.github.mikephil.charting.charts.BarChart
import com.github.mikephil.charting.data.BarData
import com.github.mikephil.charting.data.BarDataSet
import com.github.mikephil.charting.data.BarEntry
import com.github.mikephil.charting.formatter.IndexAxisValueFormatter

// TODO: Rename parameter arguments, choose names that match
// the fragment initialization parameters, e.g. ARG_ITEM_NUMBER
Expand Down Expand Up @@ -95,6 +96,10 @@ class NeuroticismFragment : Fragment() {
dataEntriesExtroversion.reverse()
labelsExtroversion.reverse()

val labels = mutableListOf("NEUROTICISM",
"Anxiety", "Anger", "Depression", "Self-Consciousness", "Immoderation", "Vulnerability"
)

val barDataSetExtroversion = BarDataSet(dataEntriesExtroversion, "Conscientiousness Traits")
barDataSetExtroversion.setValueTextColor(color) // Set text color
barDataSetExtroversion.setColors(color) // Set bar color
Expand All @@ -109,7 +114,9 @@ class NeuroticismFragment : Fragment() {
extrachart.data = barDataExtroversion
extrachart.invalidate()
extrachart.setDrawBorders(false)
extrachart.xAxis.isEnabled = false
val xAxis = extrachart.xAxis
xAxis.valueFormatter = IndexAxisValueFormatter(labels)
//extrachart.xAxis.isEnabled = false
extrachart.axisLeft.isEnabled = false
extrachart.axisRight.isEnabled = false
extrachart.description.isEnabled = false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import com.github.mikephil.charting.charts.BarChart
import com.github.mikephil.charting.data.BarData
import com.github.mikephil.charting.data.BarDataSet
import com.github.mikephil.charting.data.BarEntry
import com.github.mikephil.charting.formatter.IndexAxisValueFormatter

// TODO: Rename parameter arguments, choose names that match
// the fragment initialization parameters, e.g. ARG_ITEM_NUMBER
Expand Down Expand Up @@ -95,6 +96,11 @@ class OpennessFragment : Fragment() {
dataEntriesExtroversion.reverse()
labelsExtroversion.reverse()

val labels = mutableListOf("OPENNESS",
"Imagination",
"Artistic Interests", "Emotionality", "Adventurousness", "Intellect", "Liberalism"
)

val barDataSetExtroversion = BarDataSet(dataEntriesExtroversion, "Conscientiousness Traits")
barDataSetExtroversion.setValueTextColor(color) // Set text color
barDataSetExtroversion.setColors(color) // Set bar color
Expand All @@ -105,15 +111,20 @@ class OpennessFragment : Fragment() {
startActivity(intent)
}



val barDataExtroversion = BarData(barDataSetExtroversion)
extrachart.data = barDataExtroversion
extrachart.invalidate()
extrachart.setDrawBorders(false)
extrachart.xAxis.isEnabled = false
//extrachart.xAxis.isEnabled = false
val xAxis = extrachart.xAxis
xAxis.valueFormatter = IndexAxisValueFormatter(labels)
extrachart.axisLeft.isEnabled = false
extrachart.axisRight.isEnabled = false
extrachart.description.isEnabled = false
extrachart.legend.isEnabled = false

}

companion object {
Expand Down

0 comments on commit 3b61154

Please sign in to comment.