-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
zIndex was not added to PlotOptions as it only makes sense when used in a Series and not when used in Configuration Alternate implementation to #562 Fixes #565 Fixes #331
- Loading branch information
1 parent
d0d623f
commit 34363e9
Showing
9 changed files
with
88 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
examples/src/main/java/com/vaadin/addon/charts/examples/lineandscatter/BasicLineZIndex.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package com.vaadin.addon.charts.examples.lineandscatter; | ||
|
||
import java.util.List; | ||
import java.util.concurrent.atomic.AtomicInteger; | ||
|
||
import com.vaadin.addon.charts.Chart; | ||
import com.vaadin.addon.charts.examples.SkipFromDemo; | ||
import com.vaadin.addon.charts.model.ChartType; | ||
import com.vaadin.addon.charts.model.Configuration; | ||
import com.vaadin.addon.charts.model.PlotOptionsLine; | ||
import com.vaadin.addon.charts.model.Series; | ||
import com.vaadin.ui.Component; | ||
|
||
@SkipFromDemo | ||
public class BasicLineZIndex extends BasicLine { | ||
|
||
@Override | ||
protected Component getChart() { | ||
Chart chart = (Chart) super.getChart(); | ||
Configuration configuration = chart.getConfiguration(); | ||
PlotOptionsLine options = (PlotOptionsLine) configuration | ||
.getPlotOptions(ChartType.LINE); | ||
options.setLineWidth(5); | ||
List<Series> seriesList = configuration.getSeries(); | ||
AtomicInteger seriesCount = new AtomicInteger(seriesList.size()); | ||
seriesList.forEach( | ||
series -> series.setZIndex(seriesCount.decrementAndGet())); | ||
return chart; | ||
} | ||
|
||
} |
17 changes: 17 additions & 0 deletions
17
...ion-tests/src/test/java/com/vaadin/addon/charts/testbenchtests/BasicLineZIndexTBTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package com.vaadin.addon.charts.testbenchtests; | ||
|
||
import com.vaadin.addon.charts.examples.lineandscatter.BasicLineZIndex; | ||
|
||
public class BasicLineZIndexTBTest | ||
extends AbstractSimpleScreenShotTestBenchTest { | ||
|
||
protected String getTestViewName() { | ||
return BasicLineZIndex.class.getSimpleName(); | ||
} | ||
|
||
@Override | ||
protected String getPackageName() { | ||
return "lineandscatter"; | ||
} | ||
|
||
} |
Binary file added
BIN
+49.8 KB
.../src/test/resources/screenshots/reference/BasicLineZIndex_linux_phantomjs_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+42.8 KB
...src/test/resources/screenshots/reference/BasicLineZIndex_windows_firefox_45.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+47.2 KB
...esources/screenshots/reference/BasicLineZIndex_windows_internet explorer_11.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+49.7 KB
...tests/src/test/resources/screenshots/reference/BasicLineZIndex_xp_chrome_70.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.