ios-charts

ios-charts hide values that are outside the bar bounds (stacked bar chart)

余生颓废 提交于 2019-12-08 08:51:09
问题 The values in my charts are currently being rendered outside of their respective bars, how do I make only those values that fit the bars visible? 回答1: This is a known issue, because the sub bar's height is smaller than the value text hight. You can override drawValues to filt those texts. 来源: https://stackoverflow.com/questions/37303049/ios-charts-hide-values-that-are-outside-the-bar-bounds-stacked-bar-chart

Swift chart library. How to display X axis dates in a right places

安稳与你 提交于 2019-12-08 07:26:30
问题 EDITED: This is a debug video as well. I use this library to show charts in my Swift iOS app. This is my chart: X axis is for dates and Y axis is for lifted weight for my athletes. The ocean blue dots in the middle of the charts that you see it is an intersection between a date and lifted weight. But I am not sure how a chart shows two the same dates and a dot at the middle of dates. My question is how can I set up X axis to shift Aug 23 to the middle of the screen as well or to fit a dot I

How to draw LineChartData in swift 3?

半腔热情 提交于 2019-12-08 06:58:49
问题 I switched to swift 3 and I am now struggling to get my chart data shown again. When I use it like that, I just see an empty chart. I think some initializers changed? I am using the Swift-3.0 branch. @IBOutlet weak var lineChartView: LineChartView! override func viewDidLoad() { for x in data { ... let dataSet = LineChartDataSet(yVals: dataEntries, label: player.getName()) lineChartData.addDataSet(dataSet) } lineChartView.data = lineChartData } 回答1: They changed the way, how is data

How to disable selection of bar char?

故事扮演 提交于 2019-12-08 03:30:00
问题 I have implemented a bar chart and I would like to move to a more specific on click on that bar chart. for that I am using "ChartViewDelegate(Chartviewselected)" it is working fine. but issue is first time when I select bar chart it goes smothly to next screen. but when come back on that screen selected bar shows selected default, when click on that bar again then it gets unselected. because of that chartview delegate(chartview selected) method not called . So I want to disable default

iOS Charts - single values not showing Swift

被刻印的时光 ゝ 提交于 2019-12-08 01:43:02
问题 When I have multiple points in an array for a line on a line graph, everything shows perfectly. But when there is only one point, the dot does not show. I dont know why? the delegate is being set elsewhere, but this doesnt seem to be the issue. The below examples shows Test 2 and Test exercise. The first image is where each has one value, the second they each have 2. heres my code func startChart(){ chart.dragEnabled = true chart.legend.form = .circle chart.drawGridBackgroundEnabled = false

Different colors for bars in BarChart depend on value

南笙酒味 提交于 2019-12-07 01:34:51
问题 How can I change the color of a single bar, dependent on its value, in a bar chart? For example: I have five different values (= five different bars) in my bar chart. All bars that have a value less than 30 should be red, all bars between 30 and 70 orange, and all bars above 70 should be green. 回答1: In ios-charts, the colors of the bars are set in an array. If your dataset is called barChartDataset, for example, you would set the colors like this barChartDataset.colors = [UIColor.red,UIColor

how to replace the values of labels in iOS-charts?

限于喜欢 提交于 2019-12-06 16:12:01
问题 I use IOS-charts for drawing of downloading speed. I give to chart function array of double which has byte values. It build chart. But I want to show in chart labels value in megabytes, kilobytes or byte. I can transform byte in these value with help NSByteFormatter . But there is one problem, a function that builds charts takes a single array of values (such as an array of bytes), and outputs the same values in the labels on the chart, I tried to find a solution to do this, but I found none.

add an image for each slice in iOS-chart pieChart

好久不见. 提交于 2019-12-06 11:20:50
I'm using ios-charts . I want to create a pie chart like below image. I have done all the confings, but I have problem with adding the image in the circle beside the values outside the circle. Can anybody help me how to to add the circles and image inside it ? UPDATED : note that the pie chart will scroll and those images should scroll with the related slices. UPDATED : I used @Aditya Garg sample code to draw images beside the position of labels, and my chart is now looks like this : I set the imageViewFrame like this: imageView.frame = CGRect(x: xPos-10, y: yPos+10, width: 20, height: 20)

iOS-Charts Library: x-axis labels without backing data not showing

做~自己de王妃 提交于 2019-12-06 10:15:48
问题 I am using version 3.1.1 of the popular charts library for iOS. I have run into an issue with x-axis labeling that I can't seem to find the answer for online: Let's say I want to have a chart with one x-axis label for every day of the week (namely: S, M, T, W, T, F, S). Lots of forums I've read suggest taking the approach of setting a custom value formatter on the x-axis as suggested here: https://github.com/danielgindi/Charts/issues/1340 This works for calculating labels on days for which I

iOS Charts ValueFormatter

99封情书 提交于 2019-12-06 08:09:53
问题 I am using iOS charts plugin (line chart) and wish to style the chart values (the number above each point) to a decimal number. The value is a double, but charts by default is rounding it and displaying it as an integer. I have tried the following but not working: let valueformatter = NumberFormatter() valueformatter.numberStyle = .decimal valueformatter.locale = Locale.current lineChartDataSet.valueFormatter = valueformatter as? IValueFormatter I have tried various other properties but non