Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
C
CurvedLines
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
HS-public
CurvedLines
Commits
64c5b94e
Commit
64c5b94e
authored
Dec 11, 2011
by
MichaelZ
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added multi axis support and a new example for multi axis and fill options
parent
475c9a04
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
4 deletions
+30
-4
curvedLines.js
curvedLines.js
+6
-4
exampleFillMultiAxis.js
exampleFillMultiAxis.js
+24
-0
No files found.
curvedLines.js
View file @
64c5b94e
...
...
@@ -59,6 +59,8 @@ _____________________________________________________
options:
_____________________________________________________
fill: bool true => lines get filled
fillColor: null or the color that should be used for filling
active: bool true => plugin can be used
show: bool true => series will be drawn as curved line
fit: bool true => forces the max,mins of the curve to be on the datapoints
...
...
@@ -75,6 +77,7 @@ _____________________________________________________
/*
* v0.1 initial commit
* v0.15 negative values should work now (outcommented a negative -> 0 hook hope it does no harm)
* v0.2 added fill option (thanks to monemihir) and multi axis support (thanks to soewono effendi)
*
*
*/
...
...
@@ -109,7 +112,6 @@ _____________________________________________________
//select the data sets that should be drawn with curved lines and draws them
function
draw
(
plot
,
ctx
)
{
var
series
;
var
axes
=
plot
.
getAxes
();
var
sdata
=
plot
.
getData
();
var
offset
=
plot
.
getPlotOffset
();
...
...
@@ -117,8 +119,8 @@ _____________________________________________________
series
=
sdata
[
i
];
if
(
series
.
curvedLines
.
show
&&
series
.
curvedLines
.
lineWidth
>
0
)
{
axisx
=
ax
es
.
xaxis
;
axisy
=
ax
es
.
yaxis
;
axisx
=
seri
es
.
xaxis
;
axisy
=
seri
es
.
yaxis
;
ctx
.
save
();
ctx
.
translate
(
offset
.
left
,
offset
.
top
);
...
...
@@ -366,7 +368,7 @@ _____________________________________________________
init
:
init
,
options
:
options
,
name
:
'curvedLines'
,
version
:
'0.
1
'
version
:
'0.
2
'
});
...
...
exampleFillMultiAxis.js
0 → 100644
View file @
64c5b94e
<
div
id
=
"fillAndMultiAxis"
><
/div
>
<
script
id
=
"source"
language
=
"javascript"
type
=
"text/javascript"
>
$
(
function
()
{
var
d1
=
[[
20
,
20
],
[
42
,
60
],
[
54
,
20
],
[
80
,
80
]];
var
d2
=
[[
20
,
700
],
[
80
,
300
]];
var
options
=
{
series
:
{
curvedLines
:
{
active
:
true
}
},
axis
:
{
min
:
10
,
max
:
100
},
yaxes
:
[{
min
:
10
,
max
:
90
},
{
position
:
'right'
}]
};
$
.
plot
(
$
(
"#fillAndMultiAxis"
),
[
{
data
:
d1
,
curvedLines
:
{
show
:
true
,
fill
:
true
,
fillColor
:
"#C3C3C3"
,
lineWidth
:
3
}},
{
data
:
d1
,
points
:
{
show
:
true
}},
{
data
:
d2
,
curvedLines
:
{
show
:
true
,
lineWidth
:
3
},
yaxis
:
2
},
{
data
:
d2
,
points
:
{
show
:
true
},
yaxis
:
2
}
],
options
);
});
<
/script>
\ No newline at end of file
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