Skip to content

Commit 75657f5

Browse files
authored
27466 Fix Edge issues [Update LineDot Chart to support high contrast mode] (#27)
1 parent f719e5d commit 75657f5

3 files changed

Lines changed: 23 additions & 37 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
## 1.5.0
22
* High contrast mode
33
* API 1.13.0
4+
* Fixes Edge/IE11 SVG issues
45

56
## 1.4.1
67
* Fixed chart animation for descending order of dates

src/visual.ts

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -622,14 +622,10 @@ module powerbi.extensibility.visual {
622622
}
623623

624624
private static lineDotChartPlayBtn: string = "lineDotChart__playBtn";
625-
private static lineDotChartPlayBtnTranslate: ClassAndSelector = createClassAndSelector("lineDotChartPlayBtnTranslate");
626625

627626
private static gLineDotChartPayBtn: string = "g.lineDotChart__playBtn";
628627
private static playBtnGroupDiameter: number = 34;
629628
private static playBtnGroupLineValues: string = "M0 2l10 6-10 6z";
630-
private static playBtnGroupPlayTranslate: string = "playBtnGroupPlayTranslate";
631-
private static playBtnGroupPathTranslate: string = "playBtnGroupPathTranslate";
632-
private static playBtnGroupRectTranslate: string = "playBtnGroupRectTranslate";
633629
private static playBtnGroupRectWidth: string = "2";
634630
private static playBtnGroupRectHeight: string = "12";
635631
private static StopButton: ClassAndSelector = createClassAndSelector("stop");
@@ -645,8 +641,8 @@ module powerbi.extensibility.visual {
645641
const playBtnGroup: d3.Selection<string> = playBtn
646642
.enter()
647643
.append("g")
648-
.classed(LineDotChart.lineDotChartPlayBtn, true)
649-
.classed(LineDotChart.lineDotChartPlayBtnTranslate.className, true);
644+
.attr("transform", "translate(40, 20)")
645+
.classed(LineDotChart.lineDotChartPlayBtn, true);
650646

651647
playBtnGroup.style("opacity", this.settings.play.opacity);
652648

@@ -679,8 +675,10 @@ module powerbi.extensibility.visual {
679675
.enter()
680676
.append("path")
681677
.classed("play", true)
682-
.classed(LineDotChart.playBtnGroupPlayTranslate, true)
683-
.attr("d", LineDotChart.playBtnGroupLineValues)
678+
.attr({
679+
"d": LineDotChart.playBtnGroupLineValues,
680+
"transform": "translate(-4, -8)",
681+
})
684682
.style("pointer-events", "none");
685683

686684
firstPathSelection.style("fill", this.settings.play.innerColor);
@@ -697,10 +695,12 @@ module powerbi.extensibility.visual {
697695
.enter()
698696
.append("path")
699697
.classed(LineDotChart.StopButton.className, true)
700-
.classed(LineDotChart.playBtnGroupPathTranslate, true)
701-
.attr("d", LineDotChart.playBtnGroupLineValues)
702-
.attr("transform-origin", "center")
703-
.attr("pointer-events", "none");
698+
.attr({
699+
"d": LineDotChart.playBtnGroupLineValues,
700+
"pointer-events": "none",
701+
"transform-origin": "top left",
702+
"transform": "translate(6, 8) rotate(180)"
703+
});
704704

705705
secondPathSelection.style("fill", this.settings.play.innerColor);
706706

@@ -716,10 +716,12 @@ module powerbi.extensibility.visual {
716716
.enter()
717717
.append("rect")
718718
.classed(LineDotChart.StopButton.className, true)
719-
.classed(LineDotChart.playBtnGroupRectTranslate, true)
720-
.attr("width", LineDotChart.playBtnGroupRectWidth)
721-
.attr("height", LineDotChart.playBtnGroupRectHeight)
722-
.attr("pointer-events", "none");
719+
.attr({
720+
"width": LineDotChart.playBtnGroupRectWidth,
721+
"height": LineDotChart.playBtnGroupRectHeight,
722+
"pointer-events": "none",
723+
"transform": "translate(-7, -6)",
724+
});
723725

724726
rectSelection.style("fill", this.settings.play.innerColor);
725727

@@ -889,10 +891,10 @@ module powerbi.extensibility.visual {
889891
!dotPoint.selected && hasHighlights
890892
);
891893
},
892-
"r": (dotPoint: LineDotPoint) => {
893-
return this.settings.dotoptions.dotSizeMin
894-
+ dotPoint.dot * (this.settings.dotoptions.dotSizeMax - this.settings.dotoptions.dotSizeMin);
895-
}
894+
})
895+
.attr("r", (dotPoint: LineDotPoint) => {
896+
return this.settings.dotoptions.dotSizeMin
897+
+ dotPoint.dot * (this.settings.dotoptions.dotSizeMax - this.settings.dotoptions.dotSizeMin);
896898
});
897899

898900
if (this.settings.misc.isAnimated) {

style/lineDotChart.less

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -81,20 +81,3 @@
8181
.lineDotChart__playBtn path {
8282
fill: black;
8383
}
84-
85-
.playBtnGroupPathTranslate {
86-
transform: translate(6px, 8px) rotate(180deg);
87-
transform-origin: top left;
88-
}
89-
90-
.lineDotChartPlayBtnTranslate{
91-
transform:translate(40px, 20px);
92-
}
93-
94-
.playBtnGroupPlayTranslate{
95-
transform:translate(-4px, -8px);
96-
}
97-
98-
.playBtnGroupRectTranslate{
99-
transform:translate(-7px, -6px);
100-
}

0 commit comments

Comments
 (0)