Posts

Showing posts with the label swiftcharts

Swift charts - x axis values not aligned with bars in Group bar chart

Swift charts - x axis values not aligned with bars in Group bar chart i have created the simple bar chart with the library from https://github.com/danielgindi/ios-charts still can't figure out how to aligned x axis values with grouped bars. I am using a separate class for value formatting and i have a general function for draw n number of grouped bar charts. func createGroupedBarChart(with data: ChartDataCollection) { let grpBarChartView = BarChartView() self.addSubview(grpBarChartView) self.addConstraintsWithFormat(format: "H:|-5-[v0]-5-|", views: grpBarChartView) self.addConstraintsWithFormat(format: "V:|-5-[v0]-5-|", views: grpBarChartView) grpBarChartView.noDataText = "You need to provide data for the chart." grpBarChartView.chartDescription?.text = data.chartDescription if let barGrpChartData = data.chartData as? [BarChartGrouped] { //legend let legend = grpBarChartView.legend legend.enabled...