You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ℹ Please replace this with what you did.
Hello, I use this library for bar Chart.
I want show legend equal bar chart data count. bar is show nice, but legend label is just show one label.
many googling but I can't found it.
plz how can I show legend label equal bar data count?
What did you expect to happen?
ℹ Please replace this with what you expected to happen.
What happened instead?
if I show bar data 4, then legend show 4
◼︎ data1 ◼︎ data2 ◼︎ data3 ◼︎ data4
ℹ Please replace this with of what happened instead.
Charts Environment
Charts version/Branch/Commit Number: 3.0.3
- Xcode 9 and Swift 3.2 support Version Xcode version: 9.2 Swift version: 3.2 Platform(s) running Charts: iOS 10 macOS version running Xcode: 10.12.6
Demo Project
ℹ Please link to or upload a project we can download that reproduces the issue. breedStatusChart.xAxis.valueFormatter = IndexAxisValueFormatter(values: (showChartData["key"]?.displayName)!)
func setBarCharts(dataPoints: [String], values: [Double]) -> BarChartData {
var dataEntries: [ChartDataEntry] = []
for i in 0..<dataPoints.count {
let dataEntry = BarChartDataEntry(x: Double(i), y: values[i])
dataEntries.append(dataEntry)
}
let barChartDataSet = BarChartDataSet(values: dataEntries, label: nil)
barChartDataSet.colors = tempColor()
let barChartData = BarChartData(dataSet: barChartDataSet)
barChartData.barWidth = 0.6
let pFormatter = NumberFormatter()
pFormatter.numberStyle = .none
pFormatter.maximumFractionDigits = 1
pFormatter.multiplier = 1
barChartData.setValueFormatter(DefaultValueFormatter(formatter: pFormatter))
barChartData.setValueFont(.systemFont(ofSize: 12))
barChartData.setValueTextColor(.black)
return barChartData
}
The text was updated successfully, but these errors were encountered:
var dataEntries: [BarChartDataSet] = []
for i in 0..<dataPoints.count {
let dataEntry = BarChartDataSet(values: [BarChartDataEntry(x: Double(i), y: values[i])], label: dataPoints[i])
dataEntry.colors = [barColor[i]]
dataEntries.append(dataEntry)
}
let barChartData = BarChartData(dataSets: dataEntries)
What did you do?
ℹ Please replace this with what you did.
Hello, I use this library for bar Chart.
I want show legend equal bar chart data count. bar is show nice, but legend label is just show one label.
many googling but I can't found it.
plz how can I show legend label equal bar data count?
What did you expect to happen?
ℹ Please replace this with what you expected to happen.
What happened instead?
if I show bar data 4, then legend show 4
◼︎ data1 ◼︎ data2 ◼︎ data3 ◼︎ data4
ℹ Please replace this with of what happened instead.
Charts Environment
Charts version/Branch/Commit Number: 3.0.3
- Xcode 9 and Swift 3.2 support Version
Xcode version: 9.2
Swift version: 3.2
Platform(s) running Charts: iOS 10
macOS version running Xcode: 10.12.6
Demo Project
ℹ Please link to or upload a project we can download that reproduces the issue.
breedStatusChart.xAxis.valueFormatter = IndexAxisValueFormatter(values: (showChartData["key"]?.displayName)!)
The text was updated successfully, but these errors were encountered: