Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The shape of graph becomes smaller and smaller in RadarChartGraph #3510

Closed
akira-sasaki opened this issue Jun 13, 2018 · 3 comments
Closed

Comments

@akira-sasaki
Copy link

akira-sasaki commented Jun 13, 2018

When I call setChartData() many times, the shape of graph becomes smaller and smaller in RadarChartGraph.

var entries  = [RadarChartDataEntry(value: 90),
                   RadarChartDataEntry(value: 90),
                   RadarChartDataEntry(value: 0),
                   RadarChartDataEntry(value: 90),
]

func setChartData() {
        let set = RadarChartDataSet(values: entries, label: "Brain")
        set.setColor(UIColor(red: 121/255, green: 162/255, blue: 175/255, alpha: 1))
        set.fillColor = UIColor(red: 121/255, green: 162/255, blue: 175/255, alpha: 1)
        set.drawFilledEnabled = true
        set.fillAlpha = 0.7
        set.lineWidth = 2
        set.drawHighlightCircleEnabled = true
        set.setDrawHighlightIndicators(false)
        
        let data = RadarChartData(dataSet: set)
        data.setValueFont(.systemFont(ofSize: 8, weight: .light))
        data.setDrawValues(false)
        data.setValueTextColor(.white)
        
        chartView.data = data
 }

Call setChartData(), 1 times.
img_1524

Call setChartData(), 5 times.
img_1526

Call setChartData(), 10 times.
img_1529

@thierryH91200
Copy link
Contributor

see #2207

@akira-sasaki
Copy link
Author

Thank you.
I commented out xAxis.axisMaximum and yAxis.axisMaximum.
The problem was solved successfully.

let xAxis = chartView.xAxis
        xAxis.labelFont = .systemFont(ofSize: 9, weight: .light)
        xAxis.xOffset = 0
        xAxis.yOffset = 0
        xAxis.axisMinimum = 0
        //xAxis.axisMaximum = 100
        xAxis.valueFormatter = self
        xAxis.labelTextColor = .white
        
        let yAxis = chartView.yAxis
        yAxis.labelFont = .systemFont(ofSize: 9, weight: .light)
        yAxis.labelCount = 5
        yAxis.axisMinimum = 0
        //yAxis.axisMaximum = 80
        yAxis.drawLabelsEnabled = false

@thierryH91200
Copy link
Contributor

Thank you
it is fine for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants