ios-charts

How to hide labels in ios-charts?

爱⌒轻易说出口 提交于 2019-11-29 03:11:26
I need disable some elements from my chart. I used the iOS-charts library in (Swift 2), however I can't understand how to disable the following: Hide right and left numbers Hide description color square Hide all vertical lines self.chartView.xAxis.drawGridLinesEnabled = false self.chartView.leftAxis.drawLabelsEnabled = false self.chartView.legend.enabled = false will do the job 来源: https://stackoverflow.com/questions/36713996/how-to-hide-labels-in-ios-charts

Gradient Fill in Swift for iOS-Charts

我是研究僧i 提交于 2019-11-29 02:22:53
I am trying to create a nice gradient fill as seen in the demos on the ios-charts page. However, I cannot figure this out in swift vs obj-c. Here is the obj-c code: NSArray *gradientColors = @[ (id)[ChartColorTemplates colorFromString:@"#00ff0000"].CGColor, (id)[ChartColorTemplates colorFromString:@"#ffff0000"].CGColor ]; CGGradientRef gradient = CGGradientCreateWithColors(nil, (CFArrayRef)gradientColors, nil); set1.fillAlpha = 1.f; set1.fill = [ChartFill fillWithLinearGradient:gradient angle:90.f]; Now here is my version of that in swift: let gradColors = [UIColor.cyanColor().CGColor, UIColor

How to set x-axis labels with ios charts

不问归期 提交于 2019-11-28 18:23:48
I've recently started using the ios charts library and am having trouble finding information on how to manipulate the x-axis with the swift3 update. What I want to do is label the x-axis with time values, e.g. 2:03:00, 2:03:01, 2:03:02, etc. In the tutorials I find online, this seems to be very easy; many of them use months of the year as the x-axis label. However, in the swift3 update, charts now initializes values with x and y values, and I am not sure how to use labels in this version of the library. Does anyone know how to create labels in charts with swift3? Proper Solution for X-Axis

How to achieve trackball and access label above Bar on Bar charts in Swift 3x

允我心安 提交于 2019-11-28 00:28:58
Hello Developers I am working on project where I have used danielgindi/Charts a third party library now the challenge here is I need to present a track ball like shown in the image on highest point of the chart.How can I achieve this any suggestions ?? Or how can I access the values above BarChart, I want to print something else on the highest peak(20.0) like "E"?? Unfortunately, there is no way to set an image instead of a String or Double at the value above the bar. but yes we can access the value above bar please visit the mentioned link. https://github.com/danielgindi/Charts/issues/2126

How to achieve trackball and access label above Bar on Bar charts in Swift 3x

我与影子孤独终老i 提交于 2019-11-27 19:12:00
问题 Hello Developers I am working on project where I have used danielgindi/Charts a third party library now the challenge here is I need to present a track ball like shown in the image on highest point of the chart.How can I achieve this any suggestions ?? Or how can I access the values above BarChart, I want to print something else on the highest peak(20.0) like "E"?? 回答1: Unfortunately, there is no way to set an image instead of a String or Double at the value above the bar. but yes we can

How to make a grouped BarChart with ios-charts?

雨燕双飞 提交于 2019-11-27 18:53:55
问题 I am using ios-charts library. I would like to group my inverter values so that each year is one group. Unfortunately, the number of monthly values per year may vary. My data json looks like this: {"monthlyData":[{"ERTRAG":"30.2989999055862","MONAT":"2","JAHR":"2016"},{"ERTRAG":"154.897000223398","MONAT":"1","JAHR":"2016"},{"ERTRAG":"141.996000155807","MONAT":"12","JAHR":"2015"},{"ERTRAG":"135.449000149965","MONAT":"11","JAHR":"2015"},{"ERTRAG":"319.437000751495","MONAT":"10","JAHR":"2015"},{

ios Charts 3.0 - Align x labels (dates) with plots

风流意气都作罢 提交于 2019-11-27 18:34:49
问题 I am having a hard time to migrate library Charts (from Daniel Gindi) from version 2 (Swift 2.3) to 3 (Swift 3). Basically, I can't have the x labels (dates) aligned correctly with the corresponding plots. This is what I had before in version 2: In version 2, I had values for days 7, 8, 10 and 11. So I was missing a day in the middle, but the labels were correctly alined with the plots. And here is what I have in version 3: In version 3, the "labels" in the x axis have now been replaced by

How to add Strings on X Axis in iOS-charts?

夙愿已清 提交于 2019-11-27 06:45:48
With the new release i had some troubles to create some graphs the previous code was: func setChart(dataPoints: [String], values: [Double]) { var dataEntries: [BarChartDataEntry] = [] for i in 0..<dataPoints.count { let dataEntry = BarChartDataEntry(value: values[i], xIndex: i) dataEntries.append(dataEntry) } let chartDataSet = BarChartDataSet(yVals: dataEntries, label: "Units Sold") let chartData = BarChartData(xVals: months, dataSet: chartDataSet) barChartView.data = chartData } You can pass the values for example an array of months using the line: let chartData = BarChartData(xVals: months,

How to add Strings on X Axis in iOS-charts?

主宰稳场 提交于 2019-11-26 12:38:54
问题 With the new release i had some troubles to create some graphs the previous code was: func setChart(dataPoints: [String], values: [Double]) { var dataEntries: [BarChartDataEntry] = [] for i in 0..<dataPoints.count { let dataEntry = BarChartDataEntry(value: values[i], xIndex: i) dataEntries.append(dataEntry) } let chartDataSet = BarChartDataSet(yVals: dataEntries, label: \"Units Sold\") let chartData = BarChartData(xVals: months, dataSet: chartDataSet) barChartView.data = chartData } You can