ChartView icon indicating copy to clipboard operation
ChartView copied to clipboard

Thousands of Data Points

Open TylerKitchens opened this issue 4 years ago • 2 comments

I have a data set consisting of 2,000-3,300 plots on the x axis, is there a way to make these more visible? I can't see any of my lines. The only problem is the y plots are only between 0-15

TylerKitchens avatar Apr 01 '20 17:04 TylerKitchens

Sorry, but it's not designed for handling thousands of data points, maybe later

AppPear avatar Apr 03 '20 11:04 AppPear

I would guess that you can decrease the data to display chart by removing each second element from your array. It works fine in my case, look at the example:

let dataSource:[Double] = []

func getShortedLineChartData(width: Int) -> [Double] {
    var rowData:[Double] = dataSource // your full data source
    while rowData.count > width {
        rowData = rowData.enumerated().compactMap { index, element in index % 3 == 2 ? nil : element }
    }
    return rowData
}

mroffmix avatar Jul 06 '20 08:07 mroffmix