ivnsch / SwiftCharts

Easy to use and highly customizable charts library for iOS
Apache License 2.0
2.53k stars 410 forks source link

Set string value to x-axis #285

Closed Abhishekl90 closed 7 years ago

Abhishekl90 commented 7 years ago

Hello, Thank you for this library, my requirements are to show a line chart and I want to set String values to x-axis. I have been referring to the NotNumericExample and as you suggested to use ChartAxisValueString to set string value to x-axis, but since I am new to swift and iOS, I am finding it difficult to grasp the code and implement it . So is it possible where you share a small code on how to it. These are my requirements:

  1. Set string values to x-axis
  2. Show chart as full screen when device is rotated horizontally.
  3. Get values of on touch of chart
  4. Set values for ChartAxisConfig from and to values dynamically. eg I have a drop down , and on on drop down value selection I want to show ChartAxisConfig from and to values dynamically

Thanks in advance

ivnsch commented 7 years ago

Well, those requirements can be found in the examples (there's also a wiki with a decent amount of explanations)... you will have to invest a little more time in this.

For full screen and axis change, basically each time that something changes - be it data in the chart, or the view dimensions (etc), you have remove the chart and re-initialize it with the updated state / using the updated / new view.

Abhishekl90 commented 7 years ago

Thank you for the suggestion, will look more into it.