on 05-14-2020 7:08 PM
Hi Folks,
I have implemented FUIChartView type area. As per requirement, we need to specify range for y axis.Although i check in api documentation , was trying to set following attributes.
chartView.categoryAxis.isZeroBased = false
chartView.categoryAxis.abbreviatesLabels = false
chartView.categoryAxis.explicitMax = 66.0
chartView.categoryAxis.explicitMin = 20.0
But same is not reflecting in my chart view.
Kindly help me if i am missing something.
following code is suing to setup chart view:
chartView.chartType = .area
chartView.selectionMode = FUIChartSelectionMode.all
chartView.dataSource = self
summaryView.dataSource = self
chartView.delegate = self
chartView.style.themePalette.primary2 = UIColor.orange
chartView.style.themePalette.primary4 = UIColor.gray
chartView.series.colors = UIColor.gray
chartView.series.points.isHidden = true
chartView.categoryAxis.isZeroBased = false
chartView.categoryAxis.abbreviatesLabels = false
chartView.categoryAxis.explicitMax = 66.0
chartView.categoryAxis.explicitMin = 20.0
chartView.isUserInteractionEnabled = true
Thanks,
Ruchi
Ruchi,
As Stan pointed out, categoryAxis is x axis so you need to use numericAxis for y axis. And if you want to change default settings for secondary y axis then you need to use secondaryNumericAxis.
By default the chart calculates the range from the data you passed in. So usually you don't have to specify explicitMin and explicitMax for data range unless you want to specify the range for the chart.
So your code should like this:
chartView.numericAxis.isZeroBased = false
chartView.numericAxis.explicitMax = 66.0
chartView.numericAxis.explicitMin = 20.0
Thanks,
Shen
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ruchi, I think you should be trying to set values on the numeric axis, not category axis.
**EDIT** I'm aware there was a historical limitation on this, have forwarded to the new developer.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
76 | |
9 | |
8 | |
7 | |
6 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.