You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
44 lines
1.1 KiB
44 lines
1.1 KiB
//
|
|
// BarChart.swift
|
|
// TournamentStats
|
|
//
|
|
// Created by Laurent Morvillier on 01/12/2021.
|
|
// Copyright © 2021 Stax River. All rights reserved.
|
|
//
|
|
|
|
import Foundation
|
|
import UIKit
|
|
import Charts
|
|
|
|
class BarChart : BarChartView {
|
|
|
|
override init(frame: CGRect) {
|
|
super.init(frame: frame)
|
|
|
|
self.leftAxis.labelTextColor = Fonts.graphTextColor
|
|
self.leftAxis.labelFont = Fonts.graph
|
|
self.leftAxis.drawGridLinesEnabled = false
|
|
self.leftAxis.drawZeroLineEnabled = true
|
|
self.leftAxis.axisMinimum = 0.0
|
|
|
|
self.xAxis.drawGridLinesEnabled = false
|
|
self.xAxis.drawAxisLineEnabled = false
|
|
self.xAxis.granularity = 1
|
|
self.xAxis.labelTextColor = Fonts.graphTextColor
|
|
self.xAxis.labelFont = Fonts.graph
|
|
self.xAxis.labelPosition = .bottom
|
|
|
|
self.rightAxis.enabled = false
|
|
|
|
self.legend.enabled = false
|
|
}
|
|
|
|
func setXAxisLabels(_ labels: [String]) {
|
|
self.xAxis.valueFormatter = IndexAxisValueFormatter(values: labels)
|
|
}
|
|
|
|
required init?(coder aDecoder: NSCoder) {
|
|
fatalError("init(coder:) has not been implemented")
|
|
}
|
|
|
|
}
|
|
|