ios-charts

Multiple Line Chart, don't want to plot 0 values. Swift 2

最后都变了- 提交于 2019-12-24 17:11:14
问题 I am generating a multiple line chart using ios-charts library. (danielgindi/Charts). I am creating an array to for the x-axsis which is retrieved from Core Data and if there is no value for x week, i appended a 0. I have an example array of (for the x values): [[0.0,0.0,5.6,3.0,6.0,5.4,2.1,0.0,0.0,1.3,4.1,0.0],[5.2,0.0,3.2,7.0,8.9,0.0,5.0,0.0,4.6,0.0,0.0,0.0],[3.6,1.5,3.6,0.0,0.0,3.5,0.0,4.6,5.6,2.8,8.4,0.0]] and for the y: [Jan,Feb,March,April,May,June,July,August,Sept,Oct,Nov,Dec] I have

How to constrain ios-chart to size of view

做~自己de王妃 提交于 2019-12-24 15:36:22
问题 EDIT Short version: I was displaying a graph using ios-charts with dynamic data, and it was chopping my graph off so the full vertical portion of the graph wasn't displayed properly. Certain actions (like transitioning from landscape to portrait or vice-versa) would cause the graph to be correctly displayed. Original Question I am displaying a line graph on iPhone 6 simulator running ios 9.3, using ios-charts version 2.2.4, and I'm running into a problem where the content gets vertically

How can I add the arrow of the maximum and minimum value in iOS-charts?

半世苍凉 提交于 2019-12-24 06:58:21
问题 I want to show the arrow of the maximum and minimum value just like the picture below. Does anyone have ideas about how to achieve it using iOS-Charts? Thanks a lot. 回答1: You need to write your own custom renderer for CandleStickChartView . Fortunately, in your case you need overwrite only one method. So, inherit class from CandleStickChartRenderer and override method drawValues(context: CGContext) . You can just copy/paste most of the code from parent's method and make only necessary changes

how to set space Between Labels of xAxis

↘锁芯ラ 提交于 2019-12-23 22:27:15
问题 I got a problem of chart showing,you can see it from the picture.The old version of charts has api spaceBetweenLabels to set space Between Labels. I only find api spaceMax and spaceMin in the newest version. I try to use them to set space between Labels, but that failed. I also tried to use api labelWidth to solve the problem, which failed too. enter image description here 回答1: Just set property xAxis.avoidFirstLastClippingEnabled to true , e.g. myChart.xAxis.avoidFirstLastClippingEnabled =

bitcode bundle could not be generated because iOS Charts

我怕爱的太早我们不能终老 提交于 2019-12-22 00:26:40
问题 I make app with 3d library iOS-Charts. But I get the error bitcode bundle could not be generated because was built without full bitcode. from today widget. I installed it with help Carthage and I did all the instructions. I do not know how can I fix it? I made the following screenshot from today widget target. 回答1: Please check this SO thread and see if adding the -fembed-bitcode flag in build settings works for you. iOS library to BitCode 回答2: Please try to change Enable Bitcode to No in

Remove Border and Margin around iOS Charts in Swift

爱⌒轻易说出口 提交于 2019-12-21 08:06:12
问题 I am using iOS Charts with Swift 3, and I can't figure out how to do a couple things: I want to remove the margin around the chart. I know the chart goes edge-to-edge in my UI because if I change the chart's background color, it goes all the way to the edge. How do I remove the gap indicated by the red arrows below? How do I remove the border around the whole graph (note the black arrow)? I already have totalsGraph.drawBordersEnabled = false and it doesn't work. Is there a different option

Rounded bars in ios Charts

亡梦爱人 提交于 2019-12-21 04:34:19
问题 I've created a BarChart using BarChartView from ios-Charts but I can't figure out howto add rounded corners to bars. This is the code that I'm using: let barChart: BarChartView //... var xVals = [String]() var yVals = [BarChartDataEntry]() //... let set1 = BarChartDataSet(yVals: yVals, label: "Label") set1.drawValuesEnabled = false set1.highlightLineWidth = 3 set1.colors = [UIColor.whiteColor()] barChart.data = BarChartData(xVals: xVals, dataSet: set1) I've looked for a property like set1

Charts lineChartDataset rounded values

て烟熏妆下的殇ゞ 提交于 2019-12-19 03:37:13
问题 I'm trying out a few things with the iOS Charts library with Swift 3.0. I have a question about formatting of the lineChartDataset values (displayed above each value point). Right now these values are 'double' and are displayed as 2.0 and 3.0 instead of just 2 and 3 etc. Is it possible to round these values? I tried with numberFormatter but nothing works. Any help would be appreciated. 回答1: ios-charts have been upgraded to protocol base approach for rendering the various kind of labels like

NSNumberFormatter : Show 'k' instead of ',000' in large numbers?

↘锁芯ラ 提交于 2019-12-19 02:37:06
问题 I'd like to change my large numbers from 100,000 to $100K if this is possible. This is what I have so far: let valueFormatter = NSNumberFormatter() valueFormatter.locale = NSLocale.currentLocale() valueFormatter.numberStyle = .CurrencyStyle valueFormatter.maximumFractionDigits = 0 My Question Using NSNumberFormatter, how can I output $100K rather than $100,000? My original question: This is what I have so far: self.lineChartView.leftAxis.valueFormatter = NSNumberFormatter() self.lineChartView

How to add marker to center position in ios charts while scrolling horizontally with increasing scaleX and enabling drag

℡╲_俬逩灬. 提交于 2019-12-18 13:47:10
问题 I am using the Charts framework from Daniel Cohen Gindi. I am scrolling chart horizontally by increasing scaleX value and enabled drag as described in answer of this question Set an horizontal scroll to my Barchart in swift I want to add marker at center position when user scrolls horizontally. I know "chartTranslated" delegate is called whenever user drags the chart but it doesn't contain the value of "ChartDataEntry" and "Highlighted" like in "chartValueSelected" delegate method. 回答1: