Search code examples
iosswiftchartsbar-chartios-charts

Bar chart xAxis grid lines are in centre instead besides


I spent more than half of my day on it and unable to figure out solution

drawing bar chart using Charts pod facing two problems

  1. Wanna Corner radius bars as mentioned in required Image
  2. wanna bars besides the grid line as in below image

Required required output

My output is something like this

Output

Wrong Out put


Solution

  • Two method

    1. override XAxisRender to make offset x grid line. override BarChartRenderer to add round corner
    2. use ChartLimitLine instead of x grid line. and fork Chart and change BarChartRenderer to implement round corner

    this is my demo implemented all you want with method 2