mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Graph Panel + Legend Table mode: Many series casued zero height graph, now legend will never reduce the height of the graph below 50% of row height, Fixes #1832
This commit is contained in:
parent
6fb6e44ece
commit
dabdf1b7fd
@ -1,4 +1,9 @@
|
||||
# 2.0.0 (2015-04-20)
|
||||
# 2.0.2 (unreleased)
|
||||
|
||||
**Fixes**
|
||||
- [Issue #1832](https://github.com/grafana/grafana/issues/1832). Graph Panel + Legend Table mode: Many series casued zero height graph, now legend will never reduce the height of the graph below 50% of row height.
|
||||
|
||||
# 2.0.1 (2015-04-20)
|
||||
|
||||
**Fixes**
|
||||
- [Issue #1784](https://github.com/grafana/grafana/issues/1784). Data source proxy: Fixed issue with using data source proxy when grafana is behind nginx suburl
|
||||
|
40
build.go
40
build.go
@ -19,16 +19,21 @@ import (
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/blang/semver"
|
||||
)
|
||||
|
||||
var (
|
||||
versionRe = regexp.MustCompile(`-[0-9]{1,3}-g[0-9a-f]{5,10}`)
|
||||
goarch string
|
||||
goos string
|
||||
version string = "v1"
|
||||
race bool
|
||||
workingDir string
|
||||
serverBinaryName string = "grafana-server"
|
||||
versionRe = regexp.MustCompile(`-[0-9]{1,3}-g[0-9a-f]{5,10}`)
|
||||
goarch string
|
||||
goos string
|
||||
version string = "v1"
|
||||
// deb & rpm does not support semver so have to handle their version a little differently
|
||||
linuxPackageVersion string = "v1"
|
||||
linuxPackageIteration string = ""
|
||||
race bool
|
||||
workingDir string
|
||||
serverBinaryName string = "grafana-server"
|
||||
)
|
||||
|
||||
const minGoVersion = 1.3
|
||||
@ -40,7 +45,7 @@ func main() {
|
||||
ensureGoPath()
|
||||
readVersionFromPackageJson()
|
||||
|
||||
log.Printf("Version: %s\n", version)
|
||||
log.Printf("Version: %s, Linux Version: %s, Package Iteration: %s\n", version, linuxPackageVersion, linuxPackageIteration)
|
||||
|
||||
flag.StringVar(&goarch, "goarch", runtime.GOARCH, "GOARCH")
|
||||
flag.StringVar(&goos, "goos", runtime.GOOS, "GOOS")
|
||||
@ -70,7 +75,7 @@ func main() {
|
||||
|
||||
case "package":
|
||||
//verifyGitRepoIsClean()
|
||||
grunt("release", "--pkgVer="+version)
|
||||
grunt("release")
|
||||
createLinuxPackages()
|
||||
|
||||
case "latest":
|
||||
@ -107,6 +112,17 @@ func readVersionFromPackageJson() {
|
||||
}
|
||||
|
||||
version = jsonObj["version"].(string)
|
||||
linuxPackageVersion = version
|
||||
linuxPackageIteration = ""
|
||||
|
||||
// handle pre version stuff (deb / rpm does not support semver)
|
||||
versionInfo, _ := semver.Make(version)
|
||||
|
||||
if len(versionInfo.Pre) > 0 {
|
||||
linuxPackageIteration = versionInfo.Pre[0].VersionStr
|
||||
versionInfo.Pre = make([]semver.PRVersion, 0)
|
||||
linuxPackageVersion = versionInfo.String()
|
||||
}
|
||||
}
|
||||
|
||||
type linuxPackageOptions struct {
|
||||
@ -208,10 +224,14 @@ func createPackage(options linuxPackageOptions) {
|
||||
"--config-files", options.systemdServiceFilePath,
|
||||
"--after-install", options.postinstSrc,
|
||||
"--name", "grafana",
|
||||
"--version", version,
|
||||
"--version", linuxPackageVersion,
|
||||
"-p", "./dist",
|
||||
}
|
||||
|
||||
if linuxPackageIteration != "" {
|
||||
args = append(args, "--iteration", linuxPackageIteration)
|
||||
}
|
||||
|
||||
// add dependenciesj
|
||||
for _, dep := range options.depends {
|
||||
args = append(args, "--depends", dep)
|
||||
|
@ -1,3 +1,3 @@
|
||||
{
|
||||
"version": "2.0.0-beta3",
|
||||
"version": "2.0.1",
|
||||
}
|
||||
|
@ -4,7 +4,7 @@
|
||||
"company": "Coding Instinct AB"
|
||||
},
|
||||
"name": "grafana",
|
||||
"version": "2.0.1",
|
||||
"version": "2.0.2-pre1",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "http://github.com/torkelo/grafana.git"
|
||||
|
@ -63,12 +63,13 @@ function (angular, $, kbn, moment, _, GraphTooltip) {
|
||||
render_panel();
|
||||
});
|
||||
|
||||
function getLegendHeight() {
|
||||
function getLegendHeight(panelHeight) {
|
||||
if (!scope.panel.legend.show || scope.panel.legend.rightSide) {
|
||||
return 0;
|
||||
}
|
||||
if (scope.panel.legend.alignAsTable) {
|
||||
return 30 + (25 * data.length);
|
||||
var total = 30 + (25 * data.length);
|
||||
return Math.min(total, Math.floor(panelHeight/2));
|
||||
} else {
|
||||
return 26;
|
||||
}
|
||||
@ -84,7 +85,7 @@ function (angular, $, kbn, moment, _, GraphTooltip) {
|
||||
graphHeight -= 5; // padding
|
||||
graphHeight -= scope.panel.title ? 24 : 9; // subtract panel title bar
|
||||
|
||||
graphHeight = graphHeight - getLegendHeight(); // subtract one line legend
|
||||
graphHeight = graphHeight - getLegendHeight(graphHeight); // subtract one line legend
|
||||
|
||||
elem.css('height', graphHeight + 'px');
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user