Commit dabdf1b7 by Torkel Ödegaard

Graph Panel + Legend Table mode: Many series casued zero height graph, now…

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
parent 6fb6e44e
# 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** **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 - [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
......
...@@ -19,6 +19,8 @@ import ( ...@@ -19,6 +19,8 @@ import (
"strconv" "strconv"
"strings" "strings"
"time" "time"
"github.com/blang/semver"
) )
var ( var (
...@@ -26,6 +28,9 @@ var ( ...@@ -26,6 +28,9 @@ var (
goarch string goarch string
goos string goos string
version string = "v1" 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 race bool
workingDir string workingDir string
serverBinaryName string = "grafana-server" serverBinaryName string = "grafana-server"
...@@ -40,7 +45,7 @@ func main() { ...@@ -40,7 +45,7 @@ func main() {
ensureGoPath() ensureGoPath()
readVersionFromPackageJson() 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(&goarch, "goarch", runtime.GOARCH, "GOARCH")
flag.StringVar(&goos, "goos", runtime.GOOS, "GOOS") flag.StringVar(&goos, "goos", runtime.GOOS, "GOOS")
...@@ -70,7 +75,7 @@ func main() { ...@@ -70,7 +75,7 @@ func main() {
case "package": case "package":
//verifyGitRepoIsClean() //verifyGitRepoIsClean()
grunt("release", "--pkgVer="+version) grunt("release")
createLinuxPackages() createLinuxPackages()
case "latest": case "latest":
...@@ -107,6 +112,17 @@ func readVersionFromPackageJson() { ...@@ -107,6 +112,17 @@ func readVersionFromPackageJson() {
} }
version = jsonObj["version"].(string) 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 { type linuxPackageOptions struct {
...@@ -208,10 +224,14 @@ func createPackage(options linuxPackageOptions) { ...@@ -208,10 +224,14 @@ func createPackage(options linuxPackageOptions) {
"--config-files", options.systemdServiceFilePath, "--config-files", options.systemdServiceFilePath,
"--after-install", options.postinstSrc, "--after-install", options.postinstSrc,
"--name", "grafana", "--name", "grafana",
"--version", version, "--version", linuxPackageVersion,
"-p", "./dist", "-p", "./dist",
} }
if linuxPackageIteration != "" {
args = append(args, "--iteration", linuxPackageIteration)
}
// add dependenciesj // add dependenciesj
for _, dep := range options.depends { for _, dep := range options.depends {
args = append(args, "--depends", dep) args = append(args, "--depends", dep)
......
{ {
"version": "2.0.0-beta3", "version": "2.0.1",
} }
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
"company": "Coding Instinct AB" "company": "Coding Instinct AB"
}, },
"name": "grafana", "name": "grafana",
"version": "2.0.1", "version": "2.0.2-pre1",
"repository": { "repository": {
"type": "git", "type": "git",
"url": "http://github.com/torkelo/grafana.git" "url": "http://github.com/torkelo/grafana.git"
......
...@@ -63,12 +63,13 @@ function (angular, $, kbn, moment, _, GraphTooltip) { ...@@ -63,12 +63,13 @@ function (angular, $, kbn, moment, _, GraphTooltip) {
render_panel(); render_panel();
}); });
function getLegendHeight() { function getLegendHeight(panelHeight) {
if (!scope.panel.legend.show || scope.panel.legend.rightSide) { if (!scope.panel.legend.show || scope.panel.legend.rightSide) {
return 0; return 0;
} }
if (scope.panel.legend.alignAsTable) { 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 { } else {
return 26; return 26;
} }
...@@ -84,7 +85,7 @@ function (angular, $, kbn, moment, _, GraphTooltip) { ...@@ -84,7 +85,7 @@ function (angular, $, kbn, moment, _, GraphTooltip) {
graphHeight -= 5; // padding graphHeight -= 5; // padding
graphHeight -= scope.panel.title ? 24 : 9; // subtract panel title bar 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'); elem.css('height', graphHeight + 'px');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment