I'm trying to display a graph in my app using CareKit-UI. But the default stroke width is huge and I'd like to change it. I tried to use OCKDimensionStyler
and overriding the lineWidth1
property, but it failed at updating the graph's main line.
Chart view declaration:
let chartView = OCKCartesianChartView(type: .line)
chartView.headerView.titleLabel.text = "Doxylamine"
chartView.graphView.dataSeries = [
OCKDataSeries(values: [0, 1, 1, 2, 3, 3, 2], title: "Doxylamine")
]
This property isn't editable using an
OCKStyler
, but by setting thesize
property ofOCKDataSeries
.Here's an updated version of the code:
This allows you to have multiple series on the same graph, with different stroke width for each series.