-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into update-from-template-merged
- Loading branch information
Showing
157 changed files
with
13,846 additions
and
32 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
## 1.5.0 | ||
* Added ``JsonIgnore`` to certain fields to help prevent infinite loops #174 | ||
* Corrected model for ``Title`` and ``Font`` #175 | ||
|
||
## 1.4.1 | ||
* Use ``Number`` instead of ``BigDecimal`` in some additional places #159 (@aripddev) | ||
|
||
## 1.4.0 | ||
* Simplify API by using ``Number`` instead of ``BigDecimal``, ``int`` and ``double`` for ``Datapoints`` #154 (@aripddev) | ||
|
||
## 1.3.1 | ||
* Add subtitle option #141 (@aripddev) | ||
* Add ``PointStyle#rectRounded`` #143 (@aripddev) | ||
* Add ``BubbleDataset#pointStyle`` #144 (@aripddev) | ||
* ``reverse`` property should be on the ``Scale`` object #145 | ||
* Added all available properties for ``Legend`` | ||
|
||
## 1.3.0 | ||
* Allows creation of mixed charts #128 | ||
* New chart class: ``MixedChart`` | ||
* Some classes have been renamed | ||
* ``Data`` -> ``HomogeneousData`` | ||
* ``AbstractChart`` -> ``HomogeneousChart`` | ||
* Slim down test dependencies | ||
|
||
## 1.2.0 | ||
* Add TimeScale and TimeTicks to allow building linear time charts #90 (@astappiev) | ||
* Add options for the [Zoom plugin](https://www.chartjs.org/chartjs-plugin-zoom/latest/) #117 (@astappiev) | ||
* Updated dependencies | ||
|
||
## 1.1.3 | ||
* Add ``toJsonNative`` method which doesn't run the ``isDrawable`` check #91 | ||
|
||
## 1.1.2 | ||
* ⚠️ GroupId changed from ``com.xdev-software`` to ``software.xdev`` | ||
|
||
## 1.1.1 | ||
* ``AngleLines#lineWidth`` now uses ``BigDecimal`` #76 | ||
* Updated dependencies | ||
|
||
## 1.1.0 | ||
* Added support for more [data structures](https://www.chartjs.org/docs/4.4.0/general/data-structures.html) inside ``Dataset#data`` | ||
* ``Dataset#data`` can now contain ``Object``s | ||
|
||
## 1.0.2 | ||
* Support Java 11 | ||
* Updated dependencies | ||
|
||
## 1.0.1 | ||
* Added support for [stacked bar chart with groups](https://www.chartjs.org/docs/4.4.0/samples/bar/stacked-groups.html) (@dlemaignent) | ||
|
||
## 1.0.0 | ||
Initial release | ||
|
||
Support for Chart.js v4 | ||
|
||
Noteworthy changes compared to [Chart.java](https://github.com/mdewilde/chart): | ||
* Changed the package to ``software.xdev.chartjs.model`` | ||
* All charts (e.g. ``BarChart``, ``LineChart``, ...) are now inside the ``charts`` package | ||
* Breaking API changes due to compatibility with Chart.js v4; You may checkout the migration guides | ||
* [3.x Migration Guide](https://www.chartjs.org/docs/4.3.0/migration/v3-migration.html) | ||
* [4.x Migration Guide](https://www.chartjs.org/docs/4.3.0/migration/v4-migration.html) | ||
* JSON is no longer pretty printed by default due to performance reasons | ||
* Implemented integration tests | ||
* Requires Java 17 |
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
67 changes: 67 additions & 0 deletions
67
chartjs-java-model-demo/src/main/java/software/xdev/Application.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,67 @@ | ||
package software.xdev; | ||
|
||
import java.awt.Desktop; | ||
import java.io.IOException; | ||
import java.io.UncheckedIOException; | ||
import java.nio.file.Files; | ||
import java.nio.file.Path; | ||
|
||
import software.xdev.chartjs.model.charts.BarChart; | ||
import software.xdev.chartjs.model.charts.Chart; | ||
import software.xdev.chartjs.model.data.BarData; | ||
import software.xdev.chartjs.model.dataset.BarDataset; | ||
import software.xdev.chartjs.model.options.BarOptions; | ||
|
||
|
||
public final class Application | ||
{ | ||
private Application() | ||
{ | ||
} | ||
|
||
public static void main(final String[] args) | ||
{ | ||
final BarData data = new BarData(); | ||
data.addLabels("A", "B", "C"); | ||
data.addDataset(new BarDataset() | ||
.setLabel("Dataset1") | ||
.setData(1, 3, 2)); | ||
|
||
createAndOpenTestFile(new BarChart() | ||
.setData(data) | ||
.setOptions(new BarOptions())); | ||
} | ||
|
||
@SuppressWarnings("java:S5443") // Only a demo nothing sensitive is here | ||
private static void createAndOpenTestFile(final Chart<?, ?, ?> chart) | ||
{ | ||
try | ||
{ | ||
final Path tmp = Files.createTempFile("chart_test_", ".html"); | ||
|
||
Files.writeString( | ||
tmp, | ||
String.format("<!DOCTYPE html>\n" | ||
+ "<html lang='en'>\n" | ||
+ "\t<head>\n" | ||
+ "\t\t<meta charset='UTF-8'>\n" | ||
+ "\t\t<script src=\"https://cdnjs.cloudflare.com/ajax/libs/Chart.js/4.3.0/chart.umd" | ||
+ ".js\"></script>\n" | ||
+ "\t</head>\n" | ||
+ "\t<body>\n" | ||
+ "\t\t<canvas id='c' style='border:1px solid #555;'></canvas>\n" | ||
+ "\t\t<script>\n" | ||
+ "\t\t\tnew Chart(document.getElementById('c').getContext('2d'), %s);\n" | ||
+ "\t\t</script>\n" | ||
+ "\t</body>\n" | ||
+ "</html>", chart.toJson()) | ||
); | ||
|
||
Desktop.getDesktop().browse(tmp.toUri()); | ||
} | ||
catch(final IOException e) | ||
{ | ||
throw new UncheckedIOException(e); | ||
} | ||
} | ||
} |
Oops, something went wrong.