Skip to content

Commit

Permalink
fix: correcting star count in the chart
Browse files Browse the repository at this point in the history
Co-Authored-By: Evgeny Abramovich <evg.abramovitch@gmail.com>
  • Loading branch information
caarlos0 and evg4b committed Jan 2, 2024
1 parent f8b7161 commit 7d8fe81
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions controller/chart.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,17 @@ package controller

import (
"fmt"
"io"
"net/http"
"strings"
"time"

"github.com/apex/log"
"github.com/caarlos0/httperr"
"github.com/caarlos0/starcharts/internal/cache"
"github.com/caarlos0/starcharts/internal/chart"
"github.com/caarlos0/starcharts/internal/chart/svg"
"github.com/caarlos0/starcharts/internal/github"
"io"
"net/http"
"strings"
"time"
)

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

0 comments on commit 7d8fe81

Please sign in to comment.