summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthieu <matthieu.cneude@gmail.com>2020-01-14 17:07:45 +0100
committerMatthieu <matthieu.cneude@gmail.com>2020-01-14 17:07:45 +0100
commitc9fe5d1a4e0aabfea8f6e0104164d7d27095b6b2 (patch)
tree051a82ea4688d36413e187474656530553ec0d6c
parent7f483013c89425d238b7fa2e3e390f9005e37645 (diff)
[master] Modify examplesv0.3.0
-rw-r--r--example/ga-1.yml2
-rw-r--r--example/mix-1.yml8
-rw-r--r--internal/platform/ga.go3
3 files changed, 4 insertions, 9 deletions
diff --git a/example/ga-1.yml b/example/ga-1.yml
index 7950aa2..6021fe1 100644
--- a/example/ga-1.yml
+++ b/example/ga-1.yml
@@ -6,7 +6,7 @@ general:
projects:
- name: Example
- name_options:
+ title_options:
border_color: default
text_color: default
size: XXL
diff --git a/example/mix-1.yml b/example/mix-1.yml
index bbc2a57..a2fafa2 100644
--- a/example/mix-1.yml
+++ b/example/mix-1.yml
@@ -88,9 +88,7 @@ projects:
options:
title: "sessions/users 3 weeks ago"
metric: "ga:sessionsPerUser"
- title_color: blue
- border_color: blue
- text_color: blue
+ color: blue
num_color: default
start_date: 3_weeks_ago
end_date: 3_weeks_ago
@@ -98,9 +96,7 @@ projects:
options:
title: "sessions/users 2 weeks ago"
metric: "ga:sessionsPerUser"
- title_color: blue
- text_color: magenta
- border_color: magenta
+ color: magenta
num_color: default
start_date: 2_weeks_ago
end_date: 2_weeks_ago
diff --git a/internal/platform/ga.go b/internal/platform/ga.go
index f80180b..80f3db7 100644
--- a/internal/platform/ga.go
+++ b/internal/platform/ga.go
@@ -101,7 +101,6 @@ func NewAnalyticsClient(keyfile string) (*Analytics, error) {
}
// analytics reporting v4 service
-
an.service, err = ga.NewService(context.Background(), option.WithHTTPClient(an.config.Client(context.Background())))
if err != nil {
return nil, fmt.Errorf("creating the analytics reporting service v4 object failed: %v", err)
@@ -360,7 +359,7 @@ func (c *Analytics) StackedBar(an AnalyticValues) (dim []string, new []int, ret
return formatNewReturning(resp.Reports, formater)
}
-// formatBar to return one slice of dimension which elements are all linked with the elements of one slice of values.
+// formatBar to return one slice of dimension which elements are all linked with the elements of another slice with the values.
func formatBar(reps []*ga.Report, dimFormater func(dim []string) string) (dim []string, u []int, err error) {
dimVal := map[string]int{}
for _, v := range reps {