Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
87c0a0e2
Commit
87c0a0e2
authored
Mar 13, 2013
by
Rashid Khan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Made histogram x-axis labels dynamic
parent
e2fc334b
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
6 deletions
+14
-6
config.js
+0
-4
panels/histogram/module.js
+14
-2
No files found.
config.js
View file @
87c0a0e2
...
...
@@ -3,13 +3,10 @@
elasticsearch: URL to your elasticsearch server
kibana_index: The default ES index to use for storing Kibana specific object
such as stored dashboards
timeformat: Format for time in histograms (might go away)
modules: Panel modules to load. In the future these will be inferred
from your initial dashboard, though if you share dashboards you
will probably need to list them all here
NOTE: No timezone support yet, everything is in UTC at the moment.
If you need to configure the default dashboard, please see default.json
*/
...
...
@@ -17,7 +14,6 @@ var config = new Settings(
{
elasticsearch
:
'http://localhost:9200'
,
kibana_index
:
"kibana-int"
,
timeformat
:
'mm/dd HH:MM:ss'
,
modules
:
[
'histogram'
,
'map'
,
'pie'
,
'table'
,
'stringquery'
,
'sort'
,
'timepicker'
,
'text'
,
'fields'
,
'hits'
,
'dashcontrol'
,
'column'
],
...
...
panels/histogram/module.js
View file @
87c0a0e2
...
...
@@ -209,7 +209,7 @@ angular.module('kibana.histogram', [])
timezone
:
scope
.
panel
.
timezone
,
show
:
show
[
'x-axis'
],
mode
:
"time"
,
timeformat
:
"%H:%M:%S<br>%m-%d"
,
timeformat
:
time_format
(
scope
.
panel
.
interval
)
,
label
:
"Datetime"
,
color
:
"#000"
,
},
...
...
@@ -231,6 +231,18 @@ angular.module('kibana.histogram', [])
})
}
function
time_format
(
interval
)
{
var
_int
=
interval_to_seconds
(
interval
)
if
(
_int
>=
2628000
)
return
"%m/%y"
if
(
_int
>=
86400
)
return
"%m/%d/%y"
if
(
_int
>=
60
)
return
"%H:%M<br>%m/%d"
else
return
"%H:%M:%S"
}
function
tt
(
x
,
y
,
contents
)
{
var
tooltip
=
$
(
'#pie-tooltip'
).
length
?
$
(
'#pie-tooltip'
)
:
$
(
'<div id="pie-tooltip"></div>'
);
...
...
@@ -252,7 +264,7 @@ angular.module('kibana.histogram', [])
var
percent
=
parseFloat
(
item
.
series
.
percent
).
toFixed
(
1
)
+
"%"
;
tt
(
pos
.
pageX
,
pos
.
pageY
,
item
.
datapoint
[
1
].
toFixed
(
1
)
+
" @ "
+
new
Date
(
item
.
datapoint
[
0
]).
format
(
config
.
timeformat
));
new
Date
(
item
.
datapoint
[
0
]).
format
(
'mm/dd HH:MM:ss'
));
}
else
{
$
(
"#pie-tooltip"
).
remove
();
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment