Skip to content

Commit

Permalink
CleanUp
Browse files Browse the repository at this point in the history
  • Loading branch information
Black-Fox-2022 committed May 28, 2024
1 parent 5a2df20 commit f9a73bf
Showing 1 changed file with 2 additions and 70 deletions.
72 changes: 2 additions & 70 deletions Cluster/Chart/BarChart/BarCharTopN.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,10 @@ struct BarChartTopN: View {
}
}
.chartForegroundStyleScale(range: Color.chartColors)
/*.chartXAxis {
AxisMarks(values: .stride(by: .hour)) { date in
AxisValueLabel(format: .dateTime.hour())
}
}*/

}

// swiftlint:disable cyclomatic_complexity
func granularity() -> Calendar.Component{
switch query.granularity {
case .all:
Expand Down Expand Up @@ -72,12 +68,12 @@ struct BarChartTopN: View {
.year
}
}
// swiftlint:enable cyclomatic_complexity

func getBarMark(timeStamp: Date, name: String, metricValue: Double, metricName: String) -> some ChartContent {
return BarMark(
x: .value("Date", timeStamp, unit: granularity()),
y: .value(name, metricValue)
// width: .fixed(200),
)
.foregroundStyle(by: .value(getDimensionName(from: query.dimension) ?? "Not found", metricName))
}
Expand Down Expand Up @@ -180,67 +176,3 @@ struct BarChartTopN: View {
}

}

/*
{
"aggregations": [
{
"fieldName": "count",
"name": "count",
"type": "longSum"
}
],
"appID": "A5811BD5-87E6-4915-B419-9E48A2C39470",
"baseFilters": "thisApp",
"dimension": {
"dimension": "appVersion",
"outputName": "appVersion",
"type": "default"
},
"filter": {
"fields": [
{
"dimension": "type",
"type": "selector",
"value": "GoalView Actions"
}
],
"type": "and"
},
"granularity": "all",
"metric": {
"metric": "count",
"type": "numeric"
},
"queryType": "topN",
"threshold": 200
}




🌍 GET https://api.telemetrydeck.com/api/v3/task/1632de773afdcabbf7f8a26b6579019b81420604b16e2e3a2fafb456a158589e/lastSuccessfulValue/
⬅️ {
"calculationFinishedAt" : "2024-05-27T07:40:55+0000",
"result" : {
"type" : "topNResult",
"rows" : [
{
"result" : [
{
"appVersion" : "1.96",
"count" : 268
},
{
"appVersion" : "1.97",
"count" : 186
}
],
"timestamp" : "2024-04-27T00:00:00+0000"
}
]
},
"calculationDuration" : 0.36362302303314209
}

*/

0 comments on commit f9a73bf

Please sign in to comment.