Related
I've been hit by this iframe that breaks all my clicks and after adding { force: true } to it, it just moves to break should() assertions.
I don't know what this iframe is and it's not visible in the html when you are using the app. Is there a solution for this?
HTML of this button:
<button class="MuiButtonBase-root makeStyles-root-1080 makeStyles-sm-1082 makeStyles-sm-1303 makeStyles-ghost-1088 makeStyles-ghost-1308 makeStyles-button-1161 makeStyles-defaultState-1163 makeStyles-defaultState-1298" tabindex="0" type="button" aria-label="Lobby" data-cy="lobby-button" color="dark"><div class="makeStyles-contentWrapper-1093"><div class="makeStyles-content-1094 makeStyles-content-1310 makeStyles-content-1167"><span class="MuiBadge-root"><svg width="34" height="34" viewBox="0 0 34 34" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M21.7273 15.8571C23.6891 15.8571 25.2609 14.3257 25.2609 12.4286C25.2609 10.5314 23.6891 9 21.7273 9C19.7655 9 18.1818 10.5314 18.1818 12.4286C18.1818 14.3257 19.7655 15.8571 21.7273 15.8571ZM12.2727 15.8571C14.2345 15.8571 15.8064 14.3257 15.8064 12.4286C15.8064 10.5314 14.2345 9 12.2727 9C10.3109 9 8.72727 10.5314 8.72727 12.4286C8.72727 14.3257 10.3109 15.8571 12.2727 15.8571ZM12.2727 18.1429C9.51909 18.1429 4 19.48 4 22.1429V23.8571C4 24.4857 4.53182 25 5.18182 25H19.3636C20.0136 25 20.5455 24.4857 20.5455 23.8571V22.1429C20.5455 19.48 15.0264 18.1429 12.2727 18.1429ZM21.7273 18.1429C21.3845 18.1429 20.9945 18.1657 20.5809 18.2C20.6045 18.2114 20.6164 18.2343 20.6282 18.2457C21.9755 19.1943 22.9091 20.4629 22.9091 22.1429V23.8571C22.9091 24.2571 22.8264 24.6457 22.6964 25H28.8182C29.4682 25 30 24.4857 30 23.8571V22.1429C30 19.48 24.4809 18.1429 21.7273 18.1429Z" fill="currentColor"></path></svg><span class="MuiBadge-badge MuiBadge-anchorOriginTopRightRectangle MuiBadge-colorError MuiBadge-invisible">0</span></span></div></div><span class="MuiTouchRipple-root"></span></button>
And click is like this
cy.get('[data-cy="lobby-button"]').click();
This went away (was fixed) after commenting out
new ReactRefreshWebpackPlugin()
from webpack.config.js
Original question:
Like in this picture but with a full triangle. And i need to be able to set the line x1,y1,x2,y2. Thanks!
this image (can't post it because I ain't got enogh reputation)
EDIT:
Im using "react-native-svg" here's what I have: a plain line :(
<Svg
height="1000"
width="1000"
>
<Line
x1={this.state.circle1.x}
y1={this.state.circle1.y}
x2={this.state.circle2.x}
y2={this.state.circle2.y}
stroke="#1abc9c"
strokeWidth="10"
/>
</Svg>
OK so I figure it out. This is probably a really bad implementation but it works. If someone can improve this answer please do:
<Svg
height="1000"
width="1000"
>
<G
rotation={(Math.atan2(this.state.point2.y - this.state.point1.y, this.state.point2.x - this.state.point1.x) * 180 / Math.PI)+45}
origin={`${this.state.point1.x}, ${this.state.point1.y}`}
>
<Path d={`M ${this.state.point1.x+8} ${this.state.point1.y+8} L ${this.state.point1.x-10} ${this.state.point1.y+10} L ${this.state.point1.x-8} ${this.state.point1.y-8} z`} fill="#1abc9c" stroke="#1abc9c" />
</G>
<G
rotation={(Math.atan2(this.state.point2.y - this.state.point1.y, this.state.point2.x - this.state.point1.x) * 180 / Math.PI)-135}
origin={`${this.state.point2.x}, ${this.state.point2.y}`}
>
<Path d={`M ${this.state.point2.x+8} ${this.state.point2.y+8} L ${this.state.point2.x-10} ${this.state.point2.y+10} L ${this.state.point2.x-8} ${this.state.point2.y-8} z`} fill="#1abc9c" stroke="#1abc9c" />
</G>
<Line
x1={this.state.point1.x}
y1={this.state.point1.y}
x2={this.state.point2.x}
y2={this.state.point2.y}
stroke="#1abc9c"
strokeWidth="10"
/>
</Svg>
Let I be the identity, D an orthonormal projection, and p a vector.
I realized that several of my lines of code combined to be (I-(I-D))(p) and I could just simplify it to D(p). In replacing it, I computed the new method along-side the old to double check I was computing the same thing (Earlier in my code I had a line that was D = I - D. The D you see here is that D.) I wasn't getting the same answer, and traced it to an error in indexing D.
Here you can see I'm using the debugger and checking portions of D and getting the wrong data returned.
The values in the data explorer on the right are what I'd expect them to be. Sometimes I get what I'd expect from D(:,:,k,1), and sometimes I don't, even when I make the queries right after each other.
The vectors those red arrows are pointing to should be the same. Nothing else changed or was computed between those lines, and k = 2 when the first line was run. I've closed MATLAB and restarted it and get the same issue every time. (D depends on random input, but I'm not altering the seed, so I get the same thing every first run after newly opening MATLAB. The way D is computed, I do expect D(:,:,1,1) to be the identity matrix.)
What in the world is going on? Any help is appreciated.
I have wondered if MATLAB is messing with me on purpose. Sometimes when I open it, a pop-up dialog box says I need to update my student license. I click the update button, but nothing ever happens and the dialog box never closes, so I click cancel.
Edit:
K>> whos D P
Name Size Bytes Class Attributes
D 4-D 4608 double
P 4x1x6 192 double
K>> size(D)
ans =
4 4 6 6
I've been playing around with A and B a bit, and I get the same thing. Sometimes it computes correctly and sometimes it doesn't.
K>> B=permute(P,[1,3,2])
B =
0.4155 0.27554 0.52338 0.6991 -0.11346 0.20999
0.53573 -0.83781 0.53182 -0.022364 0.60291 -0.62601
-0.49246 -0.46111 -0.39168 0.45919 0.42377 0.47074
0.54574 0.097595 0.53835 -0.54763 0.66637 0.58516
K>> A=D
A(:,:,1,1) =
1 0 0 0
0 1 0 0
0 0 1 0
0 0 0 1
A(:,:,2,1) =
0.99071 -0.091198 0.0020814 -0.029755
-0.091198 0.10503 0.020426 -0.292
0.0020814 0.020426 0.99953 0.0066643
-0.029755 -0.292 0.0066643 0.90473
A(:,:,3,1) =
0.46769 0.019281 -0.49725 0.036486
0.019281 0.9993 0.018011 -0.0013215
-0.49725 0.018011 0.53551 0.034083
0.036486 -0.0013215 0.034083 0.9975
A(:,:,4,1) =
0.96774 0.063488 -0.10826 0.12438
0.063488 0.87506 0.21304 -0.24477
-0.10826 0.21304 0.63673 0.41737
0.12438 -0.24477 0.41737 0.52047
A(:,:,5,1) =
0.7542 0.031217 0.42575 0.056052
0.031217 0.99604 -0.054071 -0.0071187
0.42575 -0.054071 0.26255 -0.097088
0.056052 -0.0071187 -0.097088 0.98722
A(:,:,6,1) =
0.9818 -0.10286 0.085279 0.0034902
-0.10286 0.41855 0.48208 0.01973
0.085279 0.48208 0.60031 -0.016358
0.0034902 0.01973 -0.016358 0.99933
A(:,:,1,2) =
0.99071 -0.091198 0.0020814 -0.029755
-0.091198 0.10503 0.020426 -0.292
0.0020814 0.020426 0.99953 0.0066643
-0.029755 -0.292 0.0066643 0.90473
A(:,:,2,2) =
1 0 0 0
0 1 0 0
0 0 1 0
0 0 0 1
A(:,:,3,2) =
0.97125 -0.15889 -0.0080537 -0.051131
-0.15889 0.12194 -0.044507 -0.28256
-0.0080537 -0.044507 0.99774 -0.014323
-0.051131 -0.28256 -0.014323 0.90907
A(:,:,4,2) =
0.91488 -0.16388 -0.18495 0.12967
-0.16388 0.6845 -0.35607 0.24964
-0.18495 -0.35607 0.59815 0.28174
0.12967 0.24964 0.28174 0.80247
A(:,:,5,2) =
0.95461 0.16812 0.10326 0.066372
0.16812 0.37733 -0.38244 -0.24582
0.10326 -0.38244 0.76511 -0.15098
0.066372 -0.24582 -0.15098 0.90295
A(:,:,6,2) =
0.99628 0.012018 0.052874 0.027665
0.012018 0.96117 -0.17085 -0.089393
0.052874 -0.17085 0.24833 -0.39329
0.027665 -0.089393 -0.39329 0.79422
A(:,:,1,3) =
0.46769 0.019281 -0.49725 0.036486
0.019281 0.9993 0.018011 -0.0013215
-0.49725 0.018011 0.53551 0.034083
0.036486 -0.0013215 0.034083 0.9975
A(:,:,2,3) =
0.97125 -0.15889 -0.0080537 -0.051131
-0.15889 0.12194 -0.044507 -0.28256
-0.0080537 -0.044507 0.99774 -0.014323
-0.051131 -0.28256 -0.014323 0.90907
A(:,:,3,3) =
1 0 0 0
0 1 0 0
0 0 1 0
0 0 0 1
A(:,:,4,3) =
0.98622 0.043449 -0.066709 0.085142
0.043449 0.86297 0.21038 -0.26852
-0.066709 0.21038 0.67698 0.41227
0.085142 -0.26852 0.41227 0.47382
A(:,:,5,3) =
0.62859 0.041458 0.47558 0.074661
0.041458 0.99537 -0.053085 -0.0083339
0.47558 -0.053085 0.39105 -0.0956
0.074661 -0.0083339 -0.0956 0.98499
A(:,:,6,3) =
0.95505 -0.16608 0.12371 0.0067153
-0.16608 0.38639 0.45705 0.02481
0.12371 0.45705 0.65956 -0.01848
0.0067153 0.02481 -0.01848 0.999
A(:,:,1,4) =
0.96774 0.063488 -0.10826 0.12438
0.063488 0.87506 0.21304 -0.24477
-0.10826 0.21304 0.63673 0.41737
0.12438 -0.24477 0.41737 0.52047
A(:,:,2,4) =
0.91488 -0.16388 -0.18495 0.12967
-0.16388 0.6845 -0.35607 0.24964
-0.18495 -0.35607 0.59815 0.28174
0.12967 0.24964 0.28174 0.80247
A(:,:,3,4) =
0.98622 0.043449 -0.066709 0.085142
0.043449 0.86297 0.21038 -0.26852
-0.066709 0.21038 0.67698 0.41227
0.085142 -0.26852 0.41227 0.47382
A(:,:,4,4) =
1 0 0 0
0 1 0 0
0 0 1 0
0 0 0 1
A(:,:,5,4) =
0.73864 0.20112 -0.011394 0.39048
0.20112 0.84524 0.0087678 -0.30047
-0.011394 0.0087678 0.9995 0.017023
0.39048 -0.30047 0.017023 0.41662
A(:,:,6,4) =
0.87322 -0.15647 0.0029936 0.29363
-0.15647 0.80689 0.0036946 0.36238
0.0029936 0.0036946 0.99993 -0.0069332
0.29363 0.36238 -0.0069332 0.31996
A(:,:,1,5) =
0.7542 0.031217 0.42575 0.056052
0.031217 0.99604 -0.054071 -0.0071187
0.42575 -0.054071 0.26255 -0.097088
0.056052 -0.0071187 -0.097088 0.98722
A(:,:,2,5) =
0.95461 0.16812 0.10326 0.066372
0.16812 0.37733 -0.38244 -0.24582
0.10326 -0.38244 0.76511 -0.15098
0.066372 -0.24582 -0.15098 0.90295
A(:,:,3,5) =
0.62859 0.041458 0.47558 0.074661
0.041458 0.99537 -0.053085 -0.0083339
0.47558 -0.053085 0.39105 -0.0956
0.074661 -0.0083339 -0.0956 0.98499
A(:,:,4,5) =
0.73864 0.20112 -0.011394 0.39048
0.20112 0.84524 0.0087678 -0.30047
-0.011394 0.0087678 0.9995 0.017023
0.39048 -0.30047 0.017023 0.41662
A(:,:,5,5) =
1 0 0 0
0 1 0 0
0 0 1 0
0 0 0 1
A(:,:,6,5) =
0.93556 0.24481 -0.0093576 0.016177
0.24481 0.069855 0.035553 -0.061461
-0.0093576 0.035553 0.99864 0.0023492
0.016177 -0.061461 0.0023492 0.99594
A(:,:,1,6) =
0.9818 -0.10286 0.085279 0.0034902
-0.10286 0.41855 0.48208 0.01973
0.085279 0.48208 0.60031 -0.016358
0.0034902 0.01973 -0.016358 0.99933
A(:,:,2,6) =
0.99628 0.012018 0.052874 0.027665
0.012018 0.96117 -0.17085 -0.089393
0.052874 -0.17085 0.24833 -0.39329
0.027665 -0.089393 -0.39329 0.79422
A(:,:,3,6) =
0.95505 -0.16608 0.12371 0.0067153
-0.16608 0.38639 0.45705 0.02481
0.12371 0.45705 0.65956 -0.01848
0.0067153 0.02481 -0.01848 0.999
A(:,:,4,6) =
0.87322 -0.15647 0.0029936 0.29363
-0.15647 0.80689 0.0036946 0.36238
0.0029936 0.0036946 0.99993 -0.0069332
0.29363 0.36238 -0.0069332 0.31996
A(:,:,5,6) =
0.93556 0.24481 -0.0093576 0.016177
0.24481 0.069855 0.035553 -0.061461
-0.0093576 0.035553 0.99864 0.0023492
0.016177 -0.061461 0.0023492 0.99594
A(:,:,6,6) =
1 0 0 0
0 1 0 0
0 0 1 0
0 0 0 1
Edit 2:
Added relevant code. I've been pausing the code and getting the errors inside the for loops at the end. (I believe it's also giving errors in S, but I've been focusing on D trying to figure it out.)
mtimesx is from here.
n = 4;
M = 6;
P = Normalize(2*rand(n,1,M)-1);
%differences between p_i and p_j
%sum of p_i and p_j
d = Normalize(repmat(permute(P,[1,3,2]),[1,1,M]) - repmat(P,[1,M,1]));
s = Normalize(repmat(permute(P,[1,3,2]),[1,1,M]) + repmat(P,[1,M,1]));
d(isnan(d)) = 0;
%orthogonal projection onto d(:,i,j), i.e. outer product of differences
%orthogonal projection onto s(:,i,j), i.e. outer product of sums
D = mtimesx(permute(d,[1,4,2,3]), permute(d,[4,1,2,3]));
S = mtimesx(permute(s,[1,4,2,3]), permute(s,[4,1,2,3]));
D2 = D;
S2 = S;
%projection onto the complement of d(:,i,j)
%projection onto the complement of s(:,i,j)
D = repmat(eye(n),[1,1,M,M]) - D;
S = repmat(eye(n),[1,1,M,M]) - S;
%total distance to the nearest subspace
PDist = zeros([1,M]);
PDist2 = PDist;
for j = 1:M
for k = 1:M-1
for l = k:M
if j~=k && j~=l
PDist(j) = PDist(j) + min(norm(P(:,1,j) - mtimes(D(:,:,k,l),P(:,1,j))), norm(P(:,1,j) - mtimes(S(:,:,k,l),P(:,1,j))));
PDist2(j) = PDist2(j) + min(norm(D2(:,:,k,1)*P(:,1,j)),norm(S2(:,:,k,1)*P(:,1,j)));
end
end
end
end
PDist-PDist2
Normalize.m
%Normalize
%Accepts an array (of column vectors) and normalizes the columns
function B = Normalize(A)
B = A./repmat(sqrt(sum(A.*A)),size(A,1),1);
end
The problem is that you indexed the matrices using the constant 1 instead of the variable l (lowercase L), both in the first example and in the code for computing PDist2.
In general it is good to avoid using variable names that look similar to each other and/or similar to numbers.
This can be avoided by using an editor that highlights uses different colors for variables and constants (I don't know if this is possible in MATLAB). In fact, this is how I found the error in your code. As you can see, when indexing D2 for the computation of PDist2 the number 1 is colored red.
I have a set of data that that tells me the on/off status of a component as a function of time. The data looks like this :
0 1
120 1
240 0
360 0
480 1
600 1
720 1
840 0
960 0
1080 0
1200 1
1320 1
1440 0
1560 0
1680 1
1800 0
1920 1
First column shows the time in second and the second column shows the status (1 is on, 0 is off).
I need to know the what is the 600 seconds with the most 1 in it. For example, 0-600 has 3*120 s so 360 seconds where component is on. But 120-720 has 4 etc... This means that this is not only 0-600, 600-1200, it can by any 600 seconds. The hard thing is that this is a cycle, meaning that the worst hour could be from 1920 to 480 (Note that this cycle has 2040s meaning time 2040 is also time 0). The time steps are not always equal. In this case it is a constant 120s, but it could be a mix of 120s and 150s for example.
The only thing I can think of is to scan the file from 0-600, check time is was on, 120-720, 240-840 etc... but it is very time consuming. Especially since I can have very big files.
The program is in Perl, but I only need the algorithm (if it exists). Do any of you has an idea on what would be the best approach?
Thank you
It isn't quite clear what value you're trying to calculate, but your core problem appears to be finding an algorithm for getting the samples in each sliding 600s window. The sliding window can be implemented as an array. Add new samples to the end and purge old samples to keep the total size <= 600s. The only tricky part is accounting for the time values being modulo 2040.
use strict;
use warnings;
use Data::Dump qw(pp);
my #window;
while (my $line = <DATA>) {
chomp $line;
my ($t, $on) = split / +/, $line;
# add sample to sliding window
push #window, { t => $t, on => $on};
# limit window size to 600s
while (1) {
last if #window <= 1;
my $start = $window[0]{t};
my $stop = $window[-1]{t};
# account for time values being mod 2040
if ($stop < $start) {
$stop += 2040;
}
if ($stop - $start > 600) {
# purge old sample from window
shift #window;
}
else {
last;
}
}
# do something with #window
pp \#window;
}
__DATA__
0 1
120 1
240 0
360 0
480 1
600 1
720 1
840 0
960 0
1080 0
1200 1
1320 1
1440 0
1560 0
1680 1
1800 0
1920 1
0 1
120 1
240 0
360 0
The values in #window look like this:
# no wrapping
[
{ on => 1, t => 0 },
{ on => 1, t => 120 },
{ on => 0, t => 240 },
{ on => 0, t => 360 },
{ on => 1, t => 480 },
{ on => 1, t => 600 },
]
# with wrapping
[
{ on => 0, t => 1560 },
{ on => 1, t => 1680 },
{ on => 0, t => 1800 },
{ on => 1, t => 1920 },
{ on => 1, t => 0 },
{ on => 1, t => 120 },
]
The problem may be solved in the following manner.
Define an integer n; Keep adding the ones to n until a zero occurs. That is, if a zero occurs set n to zero. In the process record the maximum n occurrence and the seconds at that time. To do this define another variable m and let m be the max value. Now if n becomes greater than m then m=n. In this way you can get near the 600s interval containing maximum number of 1s. Good luck. I hope, it worked.
Assuming that points are sorted by time, you can keep buffer of consecutive points in a way that time difference between first point and last point do not exceed 600. Here is the code in C#:
// Class for data point
class Point {
public int Time { get; private set; }
public bool On { get; private set; }
public Point(int time, bool on) {
Time = time;
On = on;
}
}
Point[] points = {
new Point(0, true),
new Point(120, true),
new Point(240, false),
new Point(360, false),
new Point(480, true),
new Point(600, true),
new Point(720, true),
new Point(840, false),
new Point(960, false),
new Point(1080, false),
new Point(1200, true),
new Point(1320, true),
new Point(1440, false),
new Point(1560, false),
new Point(1680, true),
new Point(1800, false),
new Point(1920, true),
};
int GetMaxIntervalCount(IEnumerable<Point> points) {
LinkedList<Point> buff = new LinkedList<Point>();
int buffCount = 0, res = -1;
foreach (Point point in points) {
buff.AddFirst(point);
while (buff.Count > 0) {
Point last = buff.Last.Value;
if (Math.Abs(last.Time - point.Time) > 600) {
buff.RemoveLast();
if (last.On) {
--buffCount;
}
} else {
break;
}
}
if (point.On) {
++buffCount;
}
res = Math.Max(res, buffCount);
}
return res;
}
Currently it returns only maximum count, but it can be easily adjusted to also keep actual buffer. Time complexity of a method is O(N) (each point will be
"touched" at most 2 times - on adding and deleting from buffer).
We are using the Interop PowerPoint Chart type to generate an area chart as shown in the figure. We need the "broken" y-Axis. We dont want the break on the bars itself - we need the break only on the y-Axis. But are unable to find a property or a method to achieve this.
This a winforms application. Would really appreciate some pointers...
Accidentally stumbled upon this question, and I let my curiosity takes over.
I got how it's done taken from this site.
I'm using example data from above site for this walkthrough.
The step roughly like this:
Assign cut value for data separation. Separate data using a cut value (I use cut value 7,500,000 for the example)
This is data separation from the example (above is the original, below is the separated):
May June July
London 1,234,565 1,452,369 1,478,852
Paris 2,363,645 34,568,876 5,562,413
Madrid 32,645,254 3,211,654 5,857,421
Brussels 5,914,753 5,544,221 3,620,015
Lisbon 5,824,676 4,541,258 4,015,876
Munich 2,501,478 6,325,698 4,569,872
May June July Column4 Column5 Column6
London 1,234,565 1,452,369 1,478,852 0 0 0
Paris 2,363,645 7,500,000 5,562,413 0 34,568,876 0
Madrid 7,500,000 3,211,654 5,857,421 32,645,254 0 0
Brussels 5,914,753 5,544,221 3,620,015 0 0 0
Lisbon 5,824,676 4,541,258 4,015,876 0 0 0
Munich 2,501,478 6,325,698 4,569,872 0 0 0
Assign Column4, Column5, and Column6 into secondary axis.
Dim c As Microsoft.Office.Interop.PowerPoint.Chart
Dim sc As Microsoft.Office.Interop.PowerPoint.SeriesCollection = Nothing
Dim sr As Microsoft.Office.Interop.PowerPoint.Series = Nothing
sc = c.SeriesCollection
For i = 4 To sc.Count
sr = sc.SeriesCollection(i)
sr.AxisGroup = Microsoft.Office.Interop.PowerPoint.XlAxisGroup.xlSecondary
Next
Change Primary and Secondary Axis scale to fit as though the chart was separated. I change the primary axis scale from 0 to 1.6e7, and secondary axis scale from -7.0e7 to 7.0e7. At the same time, change display unit in millions, and remove all gridlines.
Dim ax As Microsoft.Office.Interop.PowerPoint.Axes
Dim axpri As Microsoft.Office.Interop.PowerPoint.Axis
Dim axsec As Microsoft.Office.Interop.PowerPoint.Axis
ax = c.Axes
axpri = ax.Item(Microsoft.Office.Interop.PowerPoint.XlAxisType.xlValue, _
Microsoft.Office.Interop.PowerPoint.XlAxisGroup.xlPrimary)
axsec = ax.Item(Microsoft.Office.Interop.PowerPoint.XlAxisType.xlValue, _
Microsoft.Office.Interop.PowerPoint.XlAxisGroup.xlSecondary)
axpri.MinimumScale = 0
axpri.MaximumScale = 1.6e7
axpri.DisplayUnit = Microsoft.Office.Interop.PowerPoint.XlDisplayUnit.xlMillions
axpri.HasMajorGridlines = False
axpri.HasMinorGridlines = False
axsec.MinimumScale = -7.0e7
axsec.MaximumScale = 7.0e7
axsec.DisplayUnit = Microsoft.Office.Interop.PowerPoint.XlDisplayUnit.xlMillions
axsec.HasMajorGridlines = False
axsec.HasMinorGridlines = False
Change Primary and Secondary Axis number format so that each axis only show its own intended value. Primary Axis more than 8M will not be shown, and Secondary Axis less than 30M will not be shown.
axpri.TickLabels.NumberFormat = "[<=8]0;;;"
axsec.TickLabels.NumberFormat = "[>=30]0;;;"
Recolor series in Secondary Axis to match series in Primary Axis.
Dim srPrev As Microsoft.Office.Interop.PowerPoint.Series = Nothing
For i = 4 To sc.Count
sr = sc.SeriesCollection(i)
srPrev = sc.SeriesCollection(i - 3)
sr.Format.Fill.ForeColor.RGB = srPrev.Format.Fill.ForeColor.RGB
Next
Delete Legend for Column4, Column5, and Column6 for a seamless Chart Legend.
c.Legend.LegendEntries(4).Delete()
c.Legend.LegendEntries(5).Delete()
c.Legend.LegendEntries(6).Delete()
[Optional] Add a neat color gradient for Data Points that exceed cut values.
Dim p As Microsoft.Office.Interop.PowerPoint.Point = Nothing
p = c.SeriesCollection("June").Points("Paris")
p.Format.Fill.TwoColorGradient(Microsoft.Office.Core.MsoGradientStyle.msoGradientHorizontal, 1)
p.Format.Fill.GradientAngle = 270
p.Format.Fill.GradientStops.Insert(p.Format.Fill.ForeColor.RGB, 0.8)
p.Format.Fill.GradientStops.Insert(p.Format.Fill.BackColor.RGB, 0.97)
p = c.SeriesCollection("May").Points("Madrid")
p.Format.Fill.TwoColorGradient(Microsoft.Office.Core.MsoGradientStyle.msoGradientHorizontal, 1)
p.Format.Fill.GradientAngle = 270
p.Format.Fill.GradientStops.Insert(p.Format.Fill.ForeColor.RGB, 0.8)
p.Format.Fill.GradientStops.Insert(p.Format.Fill.BackColor.RGB, 0.97)
p = c.SeriesCollection("Column5").Points("Paris")
p.Format.Fill.TwoColorGradient(Microsoft.Office.Core.MsoGradientStyle.msoGradientHorizontal, 1)
p.Format.Fill.GradientAngle = 90
p.Format.Fill.GradientStops.Insert(p.Format.Fill.ForeColor.RGB, 0.7)
p.Format.Fill.GradientStops.Insert(p.Format.Fill.BackColor.RGB, 0.95)
p = c.SeriesCollection("Column4").Points("Madrid")
p.Format.Fill.TwoColorGradient(Microsoft.Office.Core.MsoGradientStyle.msoGradientHorizontal, 1)
p.Format.Fill.GradientAngle = 90
p.Format.Fill.GradientStops.Insert(p.Format.Fill.ForeColor.RGB, 0.7)
p.Format.Fill.GradientStops.Insert(p.Format.Fill.BackColor.RGB, 0.95)
Voila! Hard work pays off, a broken y axis in PowerPoint chart.