From c9fe5d1a4e0aabfea8f6e0104164d7d27095b6b2 Mon Sep 17 00:00:00 2001 From: Matthieu Date: Tue, 14 Jan 2020 17:07:45 +0100 Subject: [PATCH] [master] Modify examples --- example/ga-1.yml | 2 +- example/mix-1.yml | 8 ++------ internal/platform/ga.go | 3 +-- 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 {