began on being able to control fill style per series

This commit is contained in:
Torkel Odegaard 2014-01-10 23:04:19 +01:00
parent 903dfc615c
commit ee8ba469dd
3 changed files with 31 additions and 22 deletions

View File

@ -18,13 +18,19 @@
<script type="text/ng-template" id="colorPopup.html">
<div class="histogram-legend-popover">
<div class="histogram-legend-popover-header">
<a class="small" ng-click="toggleYAxis(series)">
Toggle Y-axis (y&sup2;)
</a>
<a class="close" ng-click="dismiss();" href="">×</a>
</div>
<div class="editor-row">
<a class="small" ng-click="toggleYAxis(series)">
2:nd Y-axis (y&sup2;) <input type="checkbox"></input>
</a>
</div>
<div class="editor-row">
Fill style <select class="input-mini" ng-model="panel.aliasFillStyle[series.alias]" ng-options="f for f in ['no', 'all', 'null']" ng-change="get_data()"></select>
</div>
<div class="editor-row">
<i ng-repeat="color in colors"
class="pointer"

View File

@ -217,7 +217,8 @@ function (angular, app, $, _, kbn, moment, timeSeries) {
targets: [],
aliasColors: {},
aliasYAxis: {}
aliasYAxis: {},
aliasFillStyle: {}
};
_.defaults($scope.panel,_d);
@ -338,15 +339,18 @@ function (angular, app, $, _, kbn, moment, timeSeries) {
if(results.length === 0 ) {
return [];
}
_.each(results, function(targetData) {
var alias = targetData.target;
var color = $scope.panel.aliasColors[alias] || $scope.colors[data.length];
var yaxis = $scope.panel.aliasYAxis[alias] || 1;
var tsOpts = {
interval: $scope.interval,
start_date: $scope.range && $scope.range.from,
end_date: $scope.range && $scope.range.to,
fill_style: 'no'
fill_style: $scope.panel.aliasFillStyle[alias] || 'no',
};
_.each(results, function(targetData) {
var time_series = new timeSeries.ZeroFilled(tsOpts);
_.each(targetData.datapoints, function(valueArray) {
@ -355,10 +359,6 @@ function (angular, app, $, _, kbn, moment, timeSeries) {
}
});
var alias = targetData.target;
var color = $scope.panel.aliasColors[alias] || $scope.colors[data.length];
var yaxis = $scope.panel.aliasYAxis[alias] || 1;
var seriesInfo = {
alias: alias,
color: color,

View File

@ -1,6 +1,6 @@
/** @scratch /configuration/config.js/1
* == Configuration
* config.js is where you will find the core Kibana configuration. This file contains parameter that
* config.js is where you will find the core Grafana configuration. This file contains parameter that
* must be set before kibana is run for the first time.
*/
define(['settings'],
@ -16,13 +16,15 @@ function (Settings) {
* ==== elasticsearch
*
* The URL to your elasticsearch server. You almost certainly don't
* want +http://localhost:9200+ here. Even if Kibana and Elasticsearch are on
* want +http://localhost:9200+ here. Even if Grafana and Elasticsearch are on
* the same host. By default this will attempt to reach ES at the same host you have
* kibana installed on. You probably want to set it to the FQDN of your
* Grafana installed on. You probably want to set it to the FQDN of your
* elasticsearch host
*/
elasticsearch: "http://"+window.location.hostname+":9200",
graphiteUrl: "http://"+window.location.hostname+":8080",
/** @scratch /configuration/config.js/5
* ==== default_route
*
@ -35,12 +37,13 @@ function (Settings) {
default_route : '/dashboard/file/default.json',
/** @scratch /configuration/config.js/5
* ==== kibana-int
* ==== Grafana-int
*
* The default ES index to use for storing Kibana specific object
* The default ES index to use for storing Grafana specific object
* such as stored dashboards
*/
kibana_index: "kibana-int",
grafana_index: "grafana-int",
/** @scratch /configuration/config.js/5
* ==== panel_name