-
-
Notifications
You must be signed in to change notification settings - Fork 429
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ChartServlet bug fixes and improvements (#2502)
* Improve exception handling * Add transparent themes * Add null annotations * Use java.time classes instead of Date and magic numbers * Upgrade XChart to 3.1.0 * Fix buggy legend position logic: Reinitialize counter to 0. So it does not work on legend position counter values of previously created charts. Use a local variable for the position counter instead of a field. This prevents issues when creating multiple charts simultanuously. For XChart release notes see: https://knowm.org/open-source/xchart/xchart-change-log/ On newer XChart versions there is an issue when using customized grid lines: knowm/XChart#628 Fixes #1183 Related to #2501 Supersedes #2415 Signed-off-by: Wouter Born <[email protected]>
- Loading branch information
Showing
14 changed files
with
357 additions
and
181 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
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
43 changes: 43 additions & 0 deletions
43
...a/org/openhab/core/ui/internal/chart/defaultchartprovider/ChartThemeBlackTransparent.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,43 @@ | ||
/** | ||
* Copyright (c) 2010-2021 Contributors to the openHAB project | ||
* | ||
* See the NOTICE file(s) distributed with this work for additional | ||
* information. | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Public License 2.0 which is available at | ||
* http://www.eclipse.org/legal/epl-2.0 | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
*/ | ||
package org.openhab.core.ui.internal.chart.defaultchartprovider; | ||
|
||
import java.awt.Color; | ||
|
||
import org.eclipse.jdt.annotation.NonNullByDefault; | ||
|
||
/** | ||
* Implementation of the black {@link ChartTheme chart theme} with transparent background. | ||
* | ||
* @author Wouter Born - Initial contribution | ||
*/ | ||
@NonNullByDefault | ||
public class ChartThemeBlackTransparent extends ChartThemeBlack { | ||
|
||
private static final String THEME_NAME = "black_transparent"; | ||
|
||
@Override | ||
public String getThemeName() { | ||
return THEME_NAME; | ||
} | ||
|
||
@Override | ||
public Color getPlotBackgroundColor() { | ||
return new Color(0, 0, 0, 0); | ||
} | ||
|
||
@Override | ||
public Color getChartBackgroundColor() { | ||
return new Color(0, 0, 0, 0); | ||
} | ||
} |
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
Oops, something went wrong.