diff --git a/godev/cmd/worker/main.go b/godev/cmd/worker/main.go
index b447aef..aebc41e 100644
--- a/godev/cmd/worker/main.go
+++ b/godev/cmd/worker/main.go
@@ -341,7 +341,7 @@
 			}
 		}
 
-		data := nest(reports)
+		data := group(reports)
 		charts := charts(cfg, start.Format(telemetry.DateOnly), end.Format(telemetry.DateOnly), data, xs)
 
 		obj := fileName(start, end)
@@ -399,17 +399,24 @@
 		prog := &program{ID: "charts:" + p.Name, Name: p.Name}
 		result.Programs = append(result.Programs, prog)
 		var charts []*chart
+		program := programName(p.Name)
 		if !telemetry.IsToolchainProgram(p.Name) {
-			charts = append(charts, d.partition(p.Name, "Version", p.Versions, compareSemver))
+			charts = append(charts, d.partition(program, "Version", toSliceOf[bucketName](p.Versions), compareSemver))
 		}
 		charts = append(charts,
-			d.partition(p.Name, "GOOS", cfg.GOOS, nil),
-			d.partition(p.Name, "GOARCH", cfg.GOARCH, nil),
-			d.partition(p.Name, "GoVersion", cfg.GoVersion, version.Compare))
+			d.partition(program, "GOOS", toSliceOf[bucketName](cfg.GOOS), nil),
+			d.partition(program, "GOARCH", toSliceOf[bucketName](cfg.GOARCH), nil),
+			d.partition(program, "GoVersion", toSliceOf[bucketName](cfg.GoVersion), version.Compare))
 		for _, c := range p.Counters {
 			// TODO: add support for histogram counters by getting the counter type
 			// from the chart config.
-			charts = append(charts, d.partition(p.Name, c.Name, tconfig.Expand(c.Name), nil))
+			chart, _ := splitCounterName(c.Name)
+			var buckets []bucketName
+			for _, counter := range tconfig.Expand(c.Name) {
+				_, bucket := splitCounterName(counter)
+				buckets = append(buckets, bucket)
+			}
+			charts = append(charts, d.partition(program, chart, buckets, nil))
 		}
 		for _, p := range charts {
 			if p != nil {
@@ -420,6 +427,15 @@
 	return result
 }
 
+// toSliceOf converts a slice of once string type to another.
+func toSliceOf[To, From ~string](s []From) []To {
+	var s2 []To
+	for _, v := range s {
+		s2 = append(s2, To(v))
+	}
+	return s2
+}
+
 // compareSemver wraps semver.Compare, to differentiate equivalent semver
 // lexically, as we want all sorting to be stable.
 func compareSemver(x, y string) int {
@@ -447,20 +463,18 @@
 // if compareBuckets is provided, it is used to sort the buckets, where
 // compareBuckets returns -1, 0, or +1 if x < y, x == y, or x > y.
 // Otherwise, buckets are sorted lexically.
-func (d data) partition(program, counter string, counters []string, compareBuckets func(x, y string) int) *chart {
-	prefix, _ := splitCounterName(counter)
+func (d data) partition(program programName, chartName graphName, buckets []bucketName, compareBuckets func(x, y string) int) *chart {
 	chart := &chart{
-		ID:   "charts:" + program + ":" + prefix,
-		Name: prefix,
+		ID:   fmt.Sprintf("charts:%s:%s", program, chartName),
+		Name: string(chartName),
 		Type: "partition",
 	}
 	pk := programName(program)
-	gk := graphName(prefix)
 
 	var (
-		counts = make(map[string]float64) // bucket name -> total count
-		empty  = true                     // keep track of empty reports, so they can be skipped
-		end    weekName                   // latest week observed
+		merged = make(map[bucketName]map[reportID]struct{}) // normalized bucket name -> merged report IDs
+		empty  = true                                       // keep track of empty reports, so they can be skipped
+		end    weekName                                     // latest week observed
 	)
 	for wk := range d {
 		if wk >= end {
@@ -468,22 +482,20 @@
 		}
 		// We group versions into major minor buckets, we must skip
 		// major minor versions we've already added to the dataset.
-		seen := make(map[string]bool)
-		for _, b := range counters {
-			// TODO(hyangah): let caller normalize names in counters.
-			counter := normalizeCounterName(counter, b)
-			if seen[counter] {
+		seen := make(map[bucketName]bool)
+		for _, bucket := range buckets {
+			if seen[bucket] {
 				continue
 			}
-			seen[counter] = true
-			ck := counterName(counter)
-			// number of reports where count prefix:bucket > 0
-			n := len(d[wk][pk][gk][ck])
-			_, bucket := splitCounterName(counter)
-
-			counts[bucket] += float64(n)
-			if n > 0 {
+			seen[bucket] = true
+			// TODO(hyangah): let caller normalize names in counters.
+			normal := normalizeCounterName(chartName, bucket)
+			if _, ok := merged[normal]; !ok {
+				merged[normal] = make(map[reportID]struct{})
+			}
+			for id := range d[wk][pk][chartName][bucket] {
 				empty = false
+				merged[normal][id] = struct{}{}
 			}
 		}
 	}
@@ -493,11 +505,11 @@
 	}
 
 	// datum.Week always points to the end date
-	for bucket, v := range counts {
+	for bucket, v := range merged {
 		d := &datum{
 			Week:  string(end),
-			Key:   bucket,
-			Value: v,
+			Key:   string(bucket),
+			Value: float64(len(v)),
 		}
 		chart.Data = append(chart.Data, d)
 	}
@@ -522,18 +534,23 @@
 
 // graphName is the graph name.
 // A graph plots distribution or timeseries of related counters.
+//
+// TODO(rfindley): rename to chartName.
 type graphName string
 
-// counterName is the counter name.
+// counterName is the counter name. counterName is graphName:bucketName.
 type counterName string
 
+// bucketName is the bucket name.
+type bucketName string
+
 // reportID is the upload report ID.
 // The current implementation uses telemetry.Report.X,
 // a random number, computed by the uploader when creating a Report object.
 // See x/telemetry/internal/upload.(*uploader).createReport.
 type reportID float64
 
-type data map[weekName]map[programName]map[graphName]map[counterName]map[reportID]int64
+type data map[weekName]map[programName]map[graphName]map[bucketName]map[reportID]int64
 
 // Names of special counters.
 // Unlike other counters, these are constructed from the metadata in the report.
@@ -544,19 +561,31 @@
 	goversionCounter = "GoVersion"
 )
 
-// nest groups the report data by week, program, prefix, counter, and x value
+// group groups the report data by week, program, prefix, counter, and x value
 // summing together counter values for each program report in a report.
-func nest(reports []telemetry.Report) data {
+func group(reports []telemetry.Report) data {
 	result := make(data)
 	for _, r := range reports {
+		var (
+			week = weekName(r.Week)
+			// x is a random number sent with each upload report.
+			// Since there is no identifier for the uploader, we use x as the uploader ID
+			// to approximate the number of unique uploader.
+			//
+			// Multiple uploads with the same x will overwrite each other, so we set the
+			// value, rather than add it to the existing value.
+			id = reportID(r.X)
+		)
 		for _, p := range r.Programs {
-			result.writeCount(r.Week, p.Program, versionCounter, p.Version, r.X, 1)
-			result.writeCount(r.Week, p.Program, goosCounter, p.GOOS, r.X, 1)
-			result.writeCount(r.Week, p.Program, goarchCounter, p.GOARCH, r.X, 1)
-			result.writeCount(r.Week, p.Program, goversionCounter, p.GoVersion, r.X, 1)
+			program := programName(p.Program)
+
+			result.writeCount(week, program, versionCounter, bucketName(p.Version), id, 1)
+			result.writeCount(week, program, goosCounter, bucketName(p.GOOS), id, 1)
+			result.writeCount(week, program, goarchCounter, bucketName(p.GOARCH), id, 1)
+			result.writeCount(week, program, goversionCounter, bucketName(p.GoVersion), id, 1)
 			for c, value := range p.Counters {
-				prefix, _ := splitCounterName(c)
-				result.writeCount(r.Week, p.Program, prefix, c, r.X, value)
+				chart, bucket := splitCounterName(c)
+				result.writeCount(week, program, chart, bucket, id, value)
 			}
 		}
 	}
@@ -566,36 +595,20 @@
 // writeCount writes the counter values to the result. When a report contains
 // multiple program reports for the same program, the value of the counters
 // in that report are summed together.
-func (d data) writeCount(week, program, prefix, counter string, x float64, value int64) {
-	wk := weekName(week)
-	if _, ok := d[wk]; !ok {
-		d[wk] = make(map[programName]map[graphName]map[counterName]map[reportID]int64)
+func (d data) writeCount(week weekName, program programName, chart graphName, bucket bucketName, id reportID, value int64) {
+	if _, ok := d[week]; !ok {
+		d[week] = make(map[programName]map[graphName]map[bucketName]map[reportID]int64)
 	}
-	pk := programName(program)
-	if _, ok := d[wk][pk]; !ok {
-		d[wk][pk] = make(map[graphName]map[counterName]map[reportID]int64)
+	if _, ok := d[week][program]; !ok {
+		d[week][program] = make(map[graphName]map[bucketName]map[reportID]int64)
 	}
-	// We want to group and plot bucket/histogram counters with the same prefix.
-	// Use the prefix as the graph name.
-	gk := graphName(prefix)
-	if _, ok := d[wk][pk][gk]; !ok {
-		d[wk][pk][gk] = make(map[counterName]map[reportID]int64)
+	if _, ok := d[week][program][chart]; !ok {
+		d[week][program][chart] = make(map[bucketName]map[reportID]int64)
 	}
-	// TODO(hyangah): let caller pass the normalized counter name.
-	counter = normalizeCounterName(prefix, counter)
-	ck := counterName(counter)
-	if _, ok := d[wk][pk][gk][ck]; !ok {
-		d[wk][pk][gk][ck] = make(map[reportID]int64)
+	if _, ok := d[week][program][chart][bucket]; !ok {
+		d[week][program][chart][bucket] = make(map[reportID]int64)
 	}
-
-	// x is a random number sent with each upload report.
-	// Since there is no identifier for the uploader, we use x as the uploader ID
-	// to approximate the number of unique uploader.
-	//
-	// Multiple uploads with the same x will overwrite each other, so we set the
-	// value, rather than add it to the existing value.
-	id := reportID(x)
-	d[wk][pk][gk][ck][id] = value
+	d[week][program][chart][bucket][id] = value
 }
 
 // normalizeCounterName normalizes the counter name.
@@ -606,35 +619,31 @@
 // To limit the cardinality of version and goVersion, this function
 // uses only major and minor version numbers in the pseudo-counter names.
 // If the counter is a normal counter name, it is returned as is.
-func normalizeCounterName(prefix, counter string) string {
-	switch prefix {
+func normalizeCounterName(chart graphName, bucket bucketName) bucketName {
+	switch chart {
 	case versionCounter:
-		if counter == "devel" {
-			return prefix + ":" + counter
+		if bucket == "devel" {
+			return bucket
 		}
-		if strings.HasPrefix(counter, "go") {
-			return prefix + ":" + goMajorMinor(counter)
+		if strings.HasPrefix(string(bucket), "go") {
+			return bucketName(goMajorMinor(string(bucket)))
 		}
-		return prefix + ":" + semver.MajorMinor(counter)
-	case goosCounter:
-		return prefix + ":" + counter
-	case goarchCounter:
-		return prefix + ":" + counter
+		return bucketName(semver.MajorMinor(string(bucket)))
 	case goversionCounter:
-		return prefix + ":" + goMajorMinor(counter)
+		return bucketName(goMajorMinor(string(bucket)))
 	}
-	return counter
+	return bucket
 }
 
 // splitCounterName gets splits the prefix and bucket splitCounterName of a counter name
 // or a bucket name. For an input with no bucket part prefix and bucket
 // are the same.
-func splitCounterName(name string) (prefix, bucket string) {
+func splitCounterName(name string) (graphName, bucketName) {
 	prefix, bucket, found := strings.Cut(name, ":")
 	if !found {
 		bucket = prefix
 	}
-	return prefix, bucket
+	return graphName(prefix), bucketName(bucket)
 }
 
 // goMajorMinor gets the go<Maj>,<Min> version for a given go version.
diff --git a/godev/cmd/worker/main_test.go b/godev/cmd/worker/main_test.go
index 3ec9be0..4ee1bde 100644
--- a/godev/cmd/worker/main_test.go
+++ b/godev/cmd/worker/main_test.go
@@ -130,7 +130,7 @@
 	},
 }
 
-func TestNest(t *testing.T) {
+func TestGroup(t *testing.T) {
 	type args struct {
 		reports []telemetry.Report
 	}
@@ -173,35 +173,35 @@
 				weekName("2999-01-01"): {
 					programName("example.com/mod/pkg"): {
 						graphName("Version"): {
-							counterName("Version:v1.2"): {
+							bucketName("v1.2.3"): {
 								reportID(0.1234567890): 1,
 							},
 						},
 						graphName("GOOS"): {
-							counterName("GOOS:darwin"): {
+							bucketName("darwin"): {
 								reportID(0.1234567890): 1,
 							},
 						},
 						graphName("GOARCH"): {
-							counterName("GOARCH:arm64"): {
+							bucketName("arm64"): {
 								reportID(0.1234567890): 1,
 							},
 						},
 						graphName("GoVersion"): {
-							counterName("GoVersion:go1.2"): {
+							bucketName("go1.2.3"): {
 								reportID(0.1234567890): 1,
 							},
 						},
 						graphName("main"): {
-							counterName("main"): {
+							bucketName("main"): {
 								reportID(0.1234567890): 1,
 							},
 						},
 						graphName("flag"): {
-							counterName("flag:a"): {
+							bucketName("a"): {
 								reportID(0.1234567890): 2,
 							},
-							counterName("flag:b"): {
+							bucketName("b"): {
 								reportID(0.1234567890): 3,
 							},
 						},
@@ -212,7 +212,7 @@
 	}
 	for _, tt := range tests {
 		t.Run(tt.name, func(t *testing.T) {
-			got := nest(tt.args.reports)
+			got := group(tt.args.reports)
 			if diff := cmp.Diff(tt.want, got); diff != "" {
 				t.Errorf("nest() mismatch (-want +got):\n%s", diff)
 			}
@@ -221,11 +221,11 @@
 }
 
 func TestPartition(t *testing.T) {
-	exampleData := nest(exampleReports)
+	exampleData := group(exampleReports)
 	type args struct {
-		program string
-		name    string
-		buckets []string
+		program programName
+		name    graphName
+		buckets []bucketName
 	}
 	tests := []struct {
 		name string
@@ -239,7 +239,7 @@
 			args: args{
 				program: "example.com/mod/pkg",
 				name:    "Version",
-				buckets: []string{"v1.2.3", "v2.3.4"},
+				buckets: []bucketName{"v1.2.3", "v2.3.4"},
 			},
 			want: &chart{
 				ID:   "charts:example.com/mod/pkg:Version",
@@ -265,7 +265,7 @@
 			args: args{
 				program: "example.com/mod/pkg",
 				name:    "Version",
-				buckets: []string{"v1.2", "v2.3"},
+				buckets: []bucketName{"v1.2.3", "v2.3.4"},
 			},
 			want: &chart{
 				ID:   "charts:example.com/mod/pkg:Version",
@@ -291,7 +291,7 @@
 			args: args{
 				program: "example.com/mod/pkg",
 				name:    "Version",
-				buckets: []string{"v1.2.3", "v2.3.4", "v1.2.3"},
+				buckets: []bucketName{"v1.2.3", "v2.3.4", "v1.2.3"},
 			},
 			want: &chart{
 				ID:   "charts:example.com/mod/pkg:Version",
@@ -317,7 +317,7 @@
 			args: args{
 				program: "example.com/mod/pkg",
 				name:    "GOOS",
-				buckets: []string{"darwin", "linux"},
+				buckets: []bucketName{"darwin", "linux"},
 			},
 			want: &chart{
 				ID:   "charts:example.com/mod/pkg:GOOS",
@@ -341,26 +341,23 @@
 			name: "three days, multiple versions",
 			data: data{
 				"2999-01-01": {"example.com/mod/pkg": {"Version": {
-					"Version":      {0.1: 5},
-					"Version:v1.2": {0.1: 2},
-					"Version:v2.3": {0.1: 3},
+					"v1.2.3": {0.1: 2},
+					"v2.3.4": {0.1: 3},
 				},
 				}},
 				"2999-01-04": {"example.com/mod/pkg": {"Version": {
-					"Version":      {0.3: 2, 0.4: 5},
-					"Version:v1.2": {0.3: 2},
-					"Version:v2.3": {0.4: 5},
+					"v1.2.3": {0.3: 2},
+					"v2.3.4": {0.4: 5},
 				},
 				}},
 				"2999-01-05": {"example.com/mod/pkg": {"Version": {
-					"Version":      {0.5: 6},
-					"Version:v2.3": {0.5: 6},
+					"v2.3.4": {0.5: 6},
 				}}},
 			},
 			args: args{
 				program: "example.com/mod/pkg",
 				name:    "Version",
-				buckets: []string{"v1.2.3", "v2.3.4"},
+				buckets: []bucketName{"v1.2.3", "v2.3.4"},
 			},
 			want: &chart{
 				ID:   "charts:example.com/mod/pkg:Version",
@@ -384,27 +381,24 @@
 			name: "three days, multiple GOOS",
 			data: data{
 				"2999-01-01": {"example.com/mod/pkg": {"GOOS": {
-					"GOOS":        {0.1: 4, 0.2: 4, 0.3: 2},
-					"GOOS:darwin": {0.1: 2, 0.2: 2, 0.3: 2},
-					"GOOS:linux":  {0.1: 2, 0.2: 2},
+					"darwin": {0.1: 2, 0.2: 2, 0.3: 2},
+					"linux":  {0.1: 2, 0.2: 2},
 				},
 				}},
 				"2999-01-02": {"example.com/mod/pkg": {"GOOS": {
-					"GOOS":        {0.4: 2, 0.5: 2, 0.6: 5},
-					"GOOS:darwin": {0.4: 2, 0.5: 2},
-					"GOOS:linux":  {0.6: 5},
+					"darwin": {0.4: 2, 0.5: 2},
+					"linux":  {0.6: 5},
 				},
 				}},
 				"2999-01-03": {"example.com/mod/pkg": {"GOOS": {
-					"GOOS":        {0.6: 3},
-					"GOOS:darwin": {0.6: 3},
+					"darwin": {0.6: 3},
 				},
 				}},
 			},
 			args: args{
 				program: "example.com/mod/pkg",
 				name:    "GOOS",
-				buckets: []string{"darwin", "linux"},
+				buckets: []bucketName{"darwin", "linux"},
 			},
 			want: &chart{
 				ID:   "charts:example.com/mod/pkg:GOOS",
@@ -428,21 +422,19 @@
 			name: "two days data, missing GOOS in first day",
 			data: data{
 				"2999-01-01": {"example.com/mod/pkg": {"Version": {
-					"Version":      {0.1: 2},
-					"Version:v1.2": {0.1: 2},
+					"v1.2": {0.1: 2},
 				},
 				}},
 				"2999-01-02": {"example.com/mod/pkg": {"GOOS": {
-					"GOOS":        {0.3: 4},
-					"GOOS:darwin": {0.3: 2},
-					"GOOS:linux":  {0.3: 2},
+					"darwin": {0.3: 2},
+					"linux":  {0.3: 2},
 				},
 				}},
 			},
 			args: args{
 				program: "example.com/mod/pkg",
 				name:    "GOOS",
-				buckets: []string{"darwin", "linux"},
+				buckets: []bucketName{"darwin", "linux"},
 			},
 			want: &chart{
 				ID:   "charts:example.com/mod/pkg:GOOS",
@@ -484,7 +476,7 @@
 			args: args{
 				program: "example.com/mod/pkg",
 				name:    "Version",
-				buckets: []string{"v1.2.3", "v2.3.4"},
+				buckets: []bucketName{"v1.2.3", "v2.3.4"},
 			},
 			want: nil,
 		},
@@ -500,7 +492,7 @@
 }
 
 func TestCharts(t *testing.T) {
-	exampleData := nest(exampleReports)
+	exampleData := group(exampleReports)
 	cfg := &config.Config{
 		UploadConfig: &telemetry.UploadConfig{
 			GOOS:       []string{"darwin"},
@@ -638,54 +630,54 @@
 
 func TestNormalizeCounterName(t *testing.T) {
 	testcases := []struct {
-		name    string
-		prefix  string
-		counter string
-		want    string
+		name   string
+		chart  graphName
+		bucket bucketName
+		want   bucketName
 	}{
 		{
-			name:    "strip patch version for Version",
-			prefix:  "Version",
-			counter: "v0.15.3",
-			want:    "Version:v0.15",
+			name:   "strip patch version for Version",
+			chart:  "Version",
+			bucket: "v0.15.3",
+			want:   "v0.15",
 		},
 		{
-			name:    "strip patch go version for Version",
-			prefix:  "Version",
-			counter: "go1.12.3",
-			want:    "Version:go1.12",
+			name:   "strip patch go version for Version",
+			chart:  "Version",
+			bucket: "go1.12.3",
+			want:   "go1.12",
 		},
 		{
-			name:    "concatenate devel for Version",
-			prefix:  "Version",
-			counter: "devel",
-			want:    "Version:devel",
+			name:   "concatenate devel for Version",
+			chart:  "Version",
+			bucket: "devel",
+			want:   "devel",
 		},
 		{
-			name:    "concatenate for GOOS",
-			prefix:  "GOOS",
-			counter: "darwin",
-			want:    "GOOS:darwin",
+			name:   "concatenate for GOOS",
+			chart:  "GOOS",
+			bucket: "darwin",
+			want:   "darwin",
 		},
 		{
-			name:    "concatenate for GOARCH",
-			prefix:  "GOARCH",
-			counter: "amd64",
-			want:    "GOARCH:amd64",
+			name:   "concatenate for GOARCH",
+			chart:  "GOARCH",
+			bucket: "amd64",
+			want:   "amd64",
 		},
 		{
-			name:    "strip patch version for GoVersion",
-			prefix:  "GoVersion",
-			counter: "go1.12.3",
-			want:    "GoVersion:go1.12",
+			name:   "strip patch version for GoVersion",
+			chart:  "GoVersion",
+			bucket: "go1.12.3",
+			want:   "go1.12",
 		},
 	}
 
 	for _, tc := range testcases {
 		t.Run(tc.name, func(t *testing.T) {
-			got := normalizeCounterName(tc.prefix, tc.counter)
+			got := normalizeCounterName(tc.chart, tc.bucket)
 			if tc.want != got {
-				t.Errorf("normalizeCounterName(%q, %q) = %q, want %q", tc.prefix, tc.counter, got, tc.want)
+				t.Errorf("normalizeCounterName(%q, %q) = %q, want %q", tc.chart, tc.bucket, got, tc.want)
 			}
 		})
 	}
@@ -693,22 +685,25 @@
 
 func TestWriteCount(t *testing.T) {
 	type keyValue struct {
-		week, program, prefix, counter string
-		x                              float64
-		value                          int64
+		week    weekName
+		program programName
+		chart   graphName
+		bucket  bucketName
+		x       reportID
+		value   int64
 	}
 	testcases := []struct {
 		name   string
 		inputs []keyValue
-		wants  []keyValue
+		want   []keyValue
 	}{
 		{
 			name: "program version counter should have value",
 			inputs: []keyValue{
 				{"2987-07-01", "golang.org/x/tools/gopls", "Version", "v0.15.3", 0.00009, 1},
 			},
-			wants: []keyValue{
-				{"2987-07-01", "golang.org/x/tools/gopls", "Version", "Version:v0.15", 0.00009, 1},
+			want: []keyValue{
+				{"2987-07-01", "golang.org/x/tools/gopls", "Version", "v0.15.3", 0.00009, 1},
 			},
 		},
 		{
@@ -716,7 +711,7 @@
 			inputs: []keyValue{
 				{"2987-06-30", "cmd/go", "go/invocations", "go/invocations", 0.86995, 84},
 			},
-			wants: []keyValue{
+			want: []keyValue{
 				{"2987-06-30", "cmd/go", "go/invocations", "go/invocations", 0.86995, 84},
 			},
 		},
@@ -727,8 +722,8 @@
 				{"2987-06-30", "golang.org/x/tools/gopls", "GOOS", "windows", 0.86018, 2},
 				{"2987-06-30", "golang.org/x/tools/gopls", "GOOS", "windows", 0.86018, 3},
 			},
-			wants: []keyValue{
-				{"2987-06-30", "golang.org/x/tools/gopls", "GOOS", "GOOS:windows", 0.86018, 3},
+			want: []keyValue{
+				{"2987-06-30", "golang.org/x/tools/gopls", "GOOS", "windows", 0.86018, 3},
 			},
 		},
 		{
@@ -737,9 +732,9 @@
 				{"2987-06-30", "golang.org/x/tools/gopls", "GOOS", "windows", 0.86018, 2},
 				{"2987-06-30", "golang.org/x/tools/gopls", "GOOS", "linux", 0.86018, 4},
 			},
-			wants: []keyValue{
-				{"2987-06-30", "golang.org/x/tools/gopls", "GOOS", "GOOS:windows", 0.86018, 2},
-				{"2987-06-30", "golang.org/x/tools/gopls", "GOOS", "GOOS:linux", 0.86018, 4},
+			want: []keyValue{
+				{"2987-06-30", "golang.org/x/tools/gopls", "GOOS", "windows", 0.86018, 2},
+				{"2987-06-30", "golang.org/x/tools/gopls", "GOOS", "linux", 0.86018, 4},
 			},
 		},
 	}
@@ -748,13 +743,13 @@
 		t.Run(tc.name, func(t *testing.T) {
 			d := make(data)
 			for _, input := range tc.inputs {
-				d.writeCount(input.week, input.program, input.prefix, input.counter, input.x, input.value)
+				d.writeCount(input.week, input.program, input.chart, input.bucket, input.x, input.value)
 			}
 
-			for _, want := range tc.wants {
-				got := d[weekName(want.week)][programName(want.program)][graphName(want.prefix)][counterName(want.counter)][reportID(want.x)]
+			for _, want := range tc.want {
+				got := d[want.week][want.program][want.chart][want.bucket][want.x]
 				if want.value != got {
-					t.Errorf("d[%q][%q][%q][%q][%v] = %v, want %v", want.week, want.program, want.prefix, want.counter, want.x, got, want.value)
+					t.Errorf("d[%q][%q][%q][%q][%v] = %v, want %v", want.week, want.program, want.chart, want.bucket, want.x, got, want.value)
 				}
 			}
 		})
