Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
D
DV-Project
Project
Project
Details
Activity
Releases
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
almohanad.hafez
DV-Project
Commits
dfa4d57a
You need to sign in or sign up before continuing.
Commit
dfa4d57a
authored
Feb 14, 2025
by
Almouhannad Hafez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix tooltip display
parent
1af0a999
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
8 deletions
+10
-8
multi-line-chart.ts
src/ts/charts/multi-line-chart.ts
+4
-2
pie-chart.ts
src/ts/charts/pie-chart.ts
+3
-4
stacked-bar-chart.ts
src/ts/charts/stacked-bar-chart.ts
+3
-2
No files found.
src/ts/charts/multi-line-chart.ts
View file @
dfa4d57a
...
...
@@ -39,7 +39,7 @@ export class MultiLineChart extends Chart {
}
protected
getDefaultContainerSize
()
{
return
{
width
:
800
,
height
:
5
00
};
return
{
width
:
800
,
height
:
4
00
};
}
protected
initVis
()
{
...
...
@@ -83,6 +83,7 @@ export class MultiLineChart extends Chart {
.
attr
(
'id'
,
'multi-line-chart-tooltip'
)
.
style
(
'opacity'
,
0
)
.
style
(
'position'
,
'absolute'
)
.
style
(
'display'
,
'none'
)
.
style
(
'background'
,
'white'
)
.
style
(
'border'
,
'1px solid black'
)
.
style
(
'padding'
,
'5px'
)
...
...
@@ -169,7 +170,8 @@ export class MultiLineChart extends Chart {
vis
.
tooltip
.
style
(
"left"
,
(
event
.
pageX
-
20
)
+
"px"
)
.
style
(
"top"
,
(
event
.
pageY
-
85
)
+
"px"
)
.
style
(
"opacity"
,
1
);
.
style
(
"opacity"
,
1
)
.
style
(
'display'
,
'block'
);
});
// Render legend //
...
...
src/ts/charts/pie-chart.ts
View file @
dfa4d57a
...
...
@@ -51,6 +51,7 @@ export class PieChart extends Chart {
.
attr
(
'id'
,
'pie-chart-tooltip'
)
.
style
(
'opacity'
,
0
)
.
style
(
'position'
,
'absolute'
)
.
style
(
'display'
,
'none'
)
.
style
(
'background'
,
'white'
)
.
style
(
'border'
,
'1px solid black'
)
.
style
(
'padding'
,
'5px'
)
...
...
@@ -124,9 +125,7 @@ export class PieChart extends Chart {
return
arcData
.
data
.
key
===
d
.
data
.
key
;
}).
attr
(
"stroke-width"
,
6
);
vis
.
tooltip
.
style
(
'display'
,
'block'
)
.
style
(
'opacity'
,
.
9
);
vis
.
tooltip
.
style
(
'opacity'
,
.
9
).
style
(
'display'
,
'block'
);
vis
.
tooltip
.
html
(
`
${
d
.
data
.
key
}
<br>Total Medals:
${
d
.
data
.
value
}
`
)
.
style
(
'left'
,
(
event
.
pageX
-
20
)
+
'px'
)
.
style
(
'top'
,
(
event
.
pageY
-
85
)
+
'px'
);
...
...
@@ -138,7 +137,7 @@ export class PieChart extends Chart {
.
on
(
"mouseout"
,
function
()
{
// Reset opacity of all arcs
arcsEnter
.
selectAll
(
"path"
).
attr
(
"opacity"
,
1
).
attr
(
'stroke-width'
,
0
);
// Reset all arcs to full opacity
vis
.
tooltip
.
style
(
'
display'
,
'none
'
);
vis
.
tooltip
.
style
(
'
opacity'
,
'0
'
);
});
// Update section
...
...
src/ts/charts/stacked-bar-chart.ts
View file @
dfa4d57a
...
...
@@ -29,7 +29,7 @@ export class StackedBarChart extends Chart {
private
colorScale
:
d3
.
ScaleOrdinal
<
string
,
unknown
,
never
>
;
private
stackGenerator
:
d3
.
Stack
<
any
,
{
[
key
:
string
]:
number
;
},
string
>
;
protected
getDefaultMargins
()
{
return
{
top
:
5
,
right
:
100
,
bottom
:
1
0
0
,
left
:
100
};
}
protected
getDefaultMargins
()
{
return
{
top
:
5
,
right
:
100
,
bottom
:
1
2
0
,
left
:
100
};
}
protected
getDefaultContainerSize
()
{
return
{
width
:
800
,
height
:
400
};
}
protected
initVis
()
{
...
...
@@ -105,6 +105,7 @@ export class StackedBarChart extends Chart {
.
attr
(
'id'
,
'stacked-bar-chart-tooltip'
)
.
style
(
'opacity'
,
0
)
.
style
(
'position'
,
'absolute'
)
.
style
(
'display'
,
'none'
)
.
style
(
'background'
,
'white'
)
.
style
(
'border'
,
'1px solid black'
)
.
style
(
'padding'
,
'5px'
)
...
...
@@ -166,7 +167,7 @@ export class StackedBarChart extends Chart {
.
attr
(
'y'
,
vis
.
height
)
.
attr
(
'height'
,
0
)
.
on
(
'mouseover'
,
function
(
event
:
any
,
d
:
any
)
{
vis
.
tooltip
.
style
(
'opacity'
,
.
9
);
vis
.
tooltip
.
style
(
'opacity'
,
.
9
)
.
style
(
'display'
,
'block'
)
;
vis
.
tooltip
.
html
(
`
${
d
.
data
.
id
}
<br>
${
d
[
1
]
-
d
[
0
]}
`
)
.
style
(
'left'
,
(
event
.
pageX
-
20
)
+
'px'
)
.
style
(
'top'
,
(
event
.
pageY
-
60
)
+
'px'
);
...
...
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