Skip to content

Commit 7d8fe81

Browse files
caarlos0evg4b
andcommitted
fix: correcting star count in the chart
Co-Authored-By: Evgeny Abramovich <[email protected]>
1 parent f8b7161 commit 7d8fe81

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

controller/chart.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,17 @@ package controller
22

33
import (
44
"fmt"
5+
"io"
6+
"net/http"
7+
"strings"
8+
"time"
9+
510
"github.com/apex/log"
611
"github.com/caarlos0/httperr"
712
"github.com/caarlos0/starcharts/internal/cache"
813
"github.com/caarlos0/starcharts/internal/chart"
914
"github.com/caarlos0/starcharts/internal/chart/svg"
1015
"github.com/caarlos0/starcharts/internal/github"
11-
"io"
12-
"net/http"
13-
"strings"
14-
"time"
1516
)
1617

1718
var stylesMap = map[string]string{
@@ -64,7 +65,7 @@ func GetRepoChart(gh *github.GitHub, cache *cache.Redis) http.Handler {
6465
}
6566
for i, star := range stargazers {
6667
series.XValues = append(series.XValues, star.StarredAt)
67-
series.YValues = append(series.YValues, float64(i))
68+
series.YValues = append(series.YValues, float64(i+1))
6869
}
6970
if len(series.XValues) < 2 {
7071
log.Info("not enough results, adding some fake ones")

0 commit comments

Comments
 (0)