ChartsOrg / Charts

Beautiful charts for iOS/tvOS/OSX! The Apple side of the crossplatform MPAndroidChart.
Apache License 2.0
27.51k stars 5.99k forks source link

ScatterChartView min&max value was blocked,how can i change spacing top&bottom? #5051

Open scp173 opened 1 year ago

scp173 commented 1 year ago

screenshot this is my chartView Setting

    chartView.leftAxis.axisMinimum = 0//min
    chartView.leftAxis.axisMaximum = 10//max
 self.setDataCount(11, range: UInt32(sliderY.value))

func setDataCount(_ count: Int, range: UInt32) {
    let values1 = (0..<count).map { (i) -> ChartDataEntry in

// let val = Double(arc4random_uniform(range) + 3) return ChartDataEntry(x: Double(i), y: Double(i)) } let set1 = ScatterChartDataSet(entries: values1, label: "DS 1") set1.setScatterShape(.circle) set1.setColor(ChartColorTemplates.colorful()[0]) set1.scatterShapeSize = 8 let data: ScatterChartData = [set1]//, set2, set3 data.setValueFont(.systemFont(ofSize: 7, weight: .light))

    chartView.data = data

}