Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
D
domotikad
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
domotika
domotikad
Commits
274d89e3
Commit
274d89e3
authored
Jan 26, 2014
by
nextime
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Optimize a little bit graph panel js
parent
53b5855f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
15 deletions
+18
-15
graph.php
Web/htdocs/gui/panels/footjs/graph.php
+18
-15
No files found.
Web/htdocs/gui/panels/footjs/graph.php
View file @
274d89e3
...
...
@@ -7,31 +7,34 @@ $daysql = getLastNDays(7, 'Y-m-d');
<script
type=
"text/javascript"
>
var
ajaxCharts
=
[];
function
plotGraph
(
settings
)
{
t
=
this
;
$
.
extend
(
t
.
settings
,
settings
);
$
.
ajax
({
async
:
false
,
url
:
t
.
settings
.
data_url
,
dataType
:
"json"
,
success
:
function
(
res
){
res
.
data
.
opt
.
axes
.
xaxis
.
renderer
=
$
.
jqplot
.
DateAxisRenderer
;
res
.
data
.
opt
.
axes
.
xaxis
.
tickRenderer
=
$
.
jqplot
.
CanvasAxisTickRenderer
;
$
(
"#"
+
t
.
settings
.
eid
).
empty
();
$
.
jqplot
(
t
.
settings
.
eid
,
res
.
data
.
data
,
res
.
data
.
opt
);
}
});
}
<?
foreach
(
$_SESSION
[
PANELS_CHARTS
]
as
$eid
=>
$chart
)
{
?>
ajaxCharts
[
ajaxCharts
.
length
]
=
{
settings
:
{
eid
:
"
<?=
$eid
?>
"
,
data_url
:
"/rest/v1.2/charts/chartbyname/
<?=
$chart
[
'name'
]
?>
/json"
},
plot
:
function
(
settings
){
t
=
this
;
$
.
extend
(
t
.
settings
,
settings
);
$
.
ajax
({
async
:
false
,
url
:
t
.
settings
.
data_url
,
dataType
:
"json"
,
success
:
function
(
res
){
res
.
data
.
opt
.
axes
.
xaxis
.
renderer
=
$
.
jqplot
.
DateAxisRenderer
;
res
.
data
.
opt
.
axes
.
xaxis
.
tickRenderer
=
$
.
jqplot
.
CanvasAxisTickRenderer
;
$
(
"#"
+
t
.
settings
.
eid
).
empty
();
$
.
jqplot
(
t
.
settings
.
eid
,
res
.
data
.
data
,
res
.
data
.
opt
);
}
});
}
plot
:
plotGraph
};
<?
...
...
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