Search code examples
iosswiftchartsios-charts

iOS Swift Chart with combine chart


I am using Charts to achieve this. I am using combine chart for this.

enter image description here

And I have achieved below things two major problems in this.

  1. Line chart scrolls down, how can I disable it?
  2. I want to add lines followed by chart
  3. How can I select default highlighted value programmatically?

enter image description here


Solution

  • 1.

    combinedChart.zoom(scaleX: 1.0, scaleY: 1.0, x: 0.0, y: 0.0)
    

    2.Use one or more of the following:

        combinedChart.xAxis.drawAxisLineEnabled = true
        combinedChart.xAxis.drawGridLinesEnabled = true
        combinedChart.rightAxis.drawGridLinesEnabled = true
        combinedChart.leftAxis.drawGridLinesEnabled = true
        combinedChart.rightAxis.drawGridLinesEnabled = true
        combinedChart.leftAxis.drawAxisLineEnabled = true
    

    3.

    combinedChart.highlightValue(x: 0, dataSetIndex: 0)