ChartsOrg / ChartsOrg/Charts

how to divide equally in multiple bar charts?

Open
#4,606 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Swift
Stars
28k
Forks
6k
PR merge metrics
No merged PRs in 30d

Description

@IBOutlet weak var barChartView: BarChartView!

let months = ["Quick Search", "Normal Search", "Advance Search"]
let totalArr = [46174,46174,46174,46174]
let succesfullSub = [36554,36554,36554,36554]
let succesfullUnsub = [12765,12765,12765,12765]
let unSucessfull = [10987,10987,10987,10987]

override func viewDidLoad() {
super.viewDidLoad()
barChartView.delegate = self


//legend
let legend = barChartView.legend
legend.enabled = true
legend.horizontalAlignment = .right
legend.verticalAlignment = .top
legend.orientation = .vertical
legend.drawInside = true
legend.yOffset = 10.0;
legend.xOffset = 10.0;
legend.yEntrySpace = 0.0;


let xaxis = barChartView.xAxis
xaxis.drawGridLinesEnabled = true
xaxis.labelPosition = .bottom
xaxis.centerAxisLabelsEnabled = true
xaxis.valueFormatter = IndexAxisValueFormatter(values:self.months)
xaxis.granularity = 1


let leftAxisFormatter = NumberFormatter()
leftAxisFormatter.maximumFractionDigits = 1

let yaxis = barChartView.leftAxis
yaxis.spaceTop = 0.35
yaxis.axisMinimum = 0
yaxis.drawGridLinesEnabled = false

barChartView.rightAxis.enabled = false

setChart()
}
func setChart() {
var dataEntries: [BarChartDataEntry] = []
var dataEntries1: [BarChartDataEntry] = []
var dataEntries2: [BarChartDataEntry] = []
var dataEntries3: [BarChartDataEntry] = []
for i in 0..

How separate equally?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.