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**
- [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 (
"strconv"
"strings"
"time"
"github.com/blang/semver"
)
var (
......@@ -26,6 +28,9 @@ var (
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"
......@@ -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)
......
{
"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');
......
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