iOS-chart: remove DataSet label and color indicator

45 Views Asked by At

While drawing a line chart I need the entire canvas to be clean, I have figured out how to clean most of the default graphics like the grid background, grid itself, rightLabels, etc.

But I have not been able to get rid of the DataSet label and line color indicator.

Cleaned Graph

1

There are 1 best solutions below

0
rptwsthi On

If you just want to remove the label and keep the color indicator pass blank "" to label the value of dataSet like:

let dataSet = LineChartDataSet(entries: chartData, label: "")

But in case you want to drop both the color indicator and label you will have to update the legend of the chartView like:

chartView.legendRenderer.legend?.enabled = false.

Let me know if you need all settings that I have updated to achieve presented chart representation.