diff --git a/xchart-demo/src/main/java/org/knowm/xchart/demo/charts/dial/DialChart01.java b/xchart-demo/src/main/java/org/knowm/xchart/demo/charts/dial/DialChart01.java
new file mode 100644
index 000000000..fbd45ab51
--- /dev/null
+++ b/xchart-demo/src/main/java/org/knowm/xchart/demo/charts/dial/DialChart01.java
@@ -0,0 +1,100 @@
+/**
+ * Copyright 2015-2017 Knowm Inc. (http://knowm.org) and contributors.
+ * Copyright 2011-2015 Xeiam LLC (http://xeiam.com) and contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.knowm.xchart.demo.charts.dial;
+
+import java.util.ArrayList;
+
+import org.knowm.xchart.DialChart;
+import org.knowm.xchart.DialChartBuilder;
+import org.knowm.xchart.SwingWrapper;
+import org.knowm.xchart.demo.charts.ExampleChart;
+
+/**
+ * Dial Chart
+ *
+ * Demonstrates the following:
+ *
+ * - Dial Chart
+ *
- DialChartBuilder
+ */
+public class DialChart01 implements ExampleChart {
+
+ public static void main(String[] args) {
+
+ ExampleChart exampleChart = new DialChart01();
+ ArrayList charts = new ArrayList();
+ {
+ DialChart chart = exampleChart.getChart();
+ chart.setTitle("Dial chart");
+ charts.add(chart);
+ }
+ {
+ DialChart chart = exampleChart.getChart();
+ chart.setTitle("Dial chart without green&red parts");
+ chart.getStyler().setRedFrom(-1);
+ chart.getStyler().setGreenFrom(-1);
+
+ charts.add(chart);
+ }
+ {
+ DialChart chart = exampleChart.getChart();
+ chart.setTitle("Dial chart with custom ticks&labels");
+ chart.getStyler().setAxisTickValues(new double[] { .33, .45, .79});
+ chart.getStyler().setAxisTickLabels(new String[] { "min", "average", "max"});
+ charts.add(chart);
+ }
+ {
+ DialChart chart = exampleChart.getChart();
+ chart.setTitle("Dial chart with custom arrow");
+ chart.getStyler().setArrowLengthPercentage(1.05);
+ chart.getStyler().setArrowArcAngle(90);
+ chart.getStyler().setArrowArcPercentage(.03);
+ charts.add(chart);
+ }
+ {
+ DialChart chart = exampleChart.getChart();
+ chart.setTitle("Full circle dial chart");
+ chart.getStyler().setArcAngle(360);
+ //chart.getStyler().setDonutThickness(1);
+ chart.getStyler().setAxisTickLabelsVisible(false);
+ charts.add(chart);
+ }
+ {
+ DialChart chart = exampleChart.getChart();
+ chart.setTitle("Full circle dial chart without donut");
+ chart.getStyler().setArcAngle(360);
+ chart.getStyler().setDonutThickness(1);
+ chart.getStyler().setAxisTickLabelsVisible(false);
+ charts.add(chart);
+ }
+ new SwingWrapper(charts).displayChartMatrix();
+ }
+
+ @Override
+ public DialChart getChart() {
+
+ // Create Chart
+ DialChart chart = new DialChartBuilder().width(480).height(400).title("Dial Chart").build();
+
+ // Series
+ chart.addSeries("Rate", 0.9381, "93.81 %");
+ chart.getStyler().setToolTipsEnabled(true);
+ chart.getStyler().setLegendVisible(false);
+
+ return chart;
+ }
+}
diff --git a/xchart/src/main/java/org/knowm/xchart/BubbleChart.java b/xchart/src/main/java/org/knowm/xchart/BubbleChart.java
index d532a106f..e11f8bfc8 100644
--- a/xchart/src/main/java/org/knowm/xchart/BubbleChart.java
+++ b/xchart/src/main/java/org/knowm/xchart/BubbleChart.java
@@ -16,8 +16,6 @@
*/
package org.knowm.xchart;
-import java.awt.BasicStroke;
-import java.awt.Color;
import java.awt.Graphics2D;
import java.util.List;
import java.util.Map;
@@ -244,14 +242,6 @@ private void setSeriesStyles() {
SeriesColorMarkerLineStyle seriesColorMarkerLineStyle = seriesColorMarkerLineStyleCycler.getNextSeriesColorMarkerLineStyle();
- /** Line Style */
- BasicStroke stroke;
-
- /** Line Color */
- Color lineColor;
-
- /** Line Width */
- float lineWidth = -1.0f;
if (series.getLineStyle() == null) { // wasn't set manually
series.setLineStyle(seriesColorMarkerLineStyle.getStroke());
}
diff --git a/xchart/src/main/java/org/knowm/xchart/DialChart.java b/xchart/src/main/java/org/knowm/xchart/DialChart.java
new file mode 100644
index 000000000..c33c1a69c
--- /dev/null
+++ b/xchart/src/main/java/org/knowm/xchart/DialChart.java
@@ -0,0 +1,178 @@
+/**
+ * Copyright 2015-2017 Knowm Inc. (http://knowm.org) and contributors.
+ * Copyright 2011-2015 Xeiam LLC (http://xeiam.com) and contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.knowm.xchart;
+
+import java.awt.Graphics2D;
+
+import org.knowm.xchart.internal.chartpart.Chart;
+import org.knowm.xchart.internal.chartpart.Legend_Pie;
+import org.knowm.xchart.internal.chartpart.Plot_Dial;
+import org.knowm.xchart.internal.style.SeriesColorMarkerLineStyle;
+import org.knowm.xchart.internal.style.SeriesColorMarkerLineStyleCycler;
+import org.knowm.xchart.style.DialStyler;
+import org.knowm.xchart.style.Styler.ChartTheme;
+import org.knowm.xchart.style.Theme;
+
+/**
+ * @author timmolter
+ */
+public class DialChart extends Chart {
+
+ public enum DialRenderStyle {
+ Polygon, Circle;
+ }
+
+ private DialRenderStyle radarRenderStyle = DialRenderStyle.Polygon;
+
+ /**
+ * Constructor - the default Chart Theme will be used (XChartTheme)
+ *
+ * @param width
+ * @param height
+ */
+ public DialChart(int width, int height) {
+
+ super(width, height, new DialStyler());
+ plot = new Plot_Dial(this);
+ legend = new Legend_Pie(this);
+ }
+
+ /**
+ * Constructor
+ *
+ * @param width
+ * @param height
+ * @param theme - pass in a instance of Theme class, probably a custom Theme.
+ */
+ public DialChart(int width, int height, Theme theme) {
+
+ this(width, height);
+ styler.setTheme(theme);
+ }
+
+ /**
+ * Constructor
+ *
+ * @param width
+ * @param height
+ * @param chartTheme - pass in the desired ChartTheme enum
+ */
+ public DialChart(int width, int height, ChartTheme chartTheme) {
+
+ this(width, height, chartTheme.newInstance(chartTheme));
+ }
+
+ /**
+ * Constructor
+ *
+ * @param chartBuilder
+ */
+ public DialChart(DialChartBuilder chartBuilder) {
+
+ this(chartBuilder.width, chartBuilder.height, chartBuilder.chartTheme);
+ setTitle(chartBuilder.title);
+ }
+
+ /**
+ * Add a series for a Dial type chart
+ *
+ * @param seriesName
+ * @param value
+ * @return
+ */
+ public DialSeries addSeries(String seriesName, double value) {
+
+ return addSeries(seriesName, value, null);
+ }
+
+ public DialSeries addSeries(String seriesName, double value, String toolTip) {
+
+ // Sanity checks
+ sanityCheck(seriesName, value);
+
+ DialSeries series = new DialSeries(seriesName, value, toolTip);
+
+ seriesMap.put(seriesName, series);
+
+ return series;
+ }
+
+ private void sanityCheck(String seriesName, double value) {
+
+ if (seriesMap.keySet().contains(seriesName)) {
+ throw new IllegalArgumentException("Series name >" + seriesName + "< has already been used. Use unique names for each series!!!");
+ }
+ if (value < 0 || value > 1) {
+ throw new IllegalArgumentException("Value must be in [0, 1] range!!!");
+ }
+
+ }
+
+ @Override
+ public void paint(Graphics2D g, int width, int height) {
+
+ setWidth(width);
+ setHeight(height);
+
+ setSeriesStyles();
+
+ paintBackground(g);
+
+ plot.paint(g);
+ chartTitle.paint(g);
+ legend.paint(g);
+ }
+
+ /**
+ * set the series color based on theme
+ */
+ private void setSeriesStyles() {
+
+ SeriesColorMarkerLineStyleCycler seriesColorMarkerLineStyleCycler = new SeriesColorMarkerLineStyleCycler(getStyler().getSeriesColors(), getStyler().getSeriesMarkers(), getStyler()
+ .getSeriesLines());
+ for (DialSeries series : getSeriesMap().values()) {
+
+ SeriesColorMarkerLineStyle seriesColorMarkerLineStyle = seriesColorMarkerLineStyleCycler.getNextSeriesColorMarkerLineStyle();
+
+ if (series.getLineStyle() == null) { // wasn't set manually
+ series.setLineStyle(seriesColorMarkerLineStyle.getStroke());
+ }
+ if (series.getLineColor() == null) { // wasn't set manually
+ series.setLineColor(seriesColorMarkerLineStyle.getColor());
+ }
+ if (series.getFillColor() == null) { // wasn't set manually
+ series.setFillColor(seriesColorMarkerLineStyle.getColor());
+ }
+ if (series.getMarker() == null) { // wasn't set manually
+ series.setMarker(seriesColorMarkerLineStyle.getMarker());
+ }
+ if (series.getMarkerColor() == null) { // wasn't set manually
+ series.setMarkerColor(seriesColorMarkerLineStyle.getColor());
+ }
+ }
+ }
+
+ public DialRenderStyle getDialRenderStyle() {
+
+ return radarRenderStyle;
+ }
+
+ public void setDialRenderStyle(DialRenderStyle radarRenderStyle) {
+
+ this.radarRenderStyle = radarRenderStyle;
+ }
+}
diff --git a/xchart/src/main/java/org/knowm/xchart/DialChartBuilder.java b/xchart/src/main/java/org/knowm/xchart/DialChartBuilder.java
new file mode 100644
index 000000000..a4edac7dc
--- /dev/null
+++ b/xchart/src/main/java/org/knowm/xchart/DialChartBuilder.java
@@ -0,0 +1,35 @@
+/**
+ * Copyright 2015-2017 Knowm Inc. (http://knowm.org) and contributors.
+ * Copyright 2011-2015 Xeiam LLC (http://xeiam.com) and contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.knowm.xchart;
+
+import org.knowm.xchart.internal.ChartBuilder;
+
+/**
+ * @author timmolter
+ */
+public class DialChartBuilder extends ChartBuilder {
+
+ public DialChartBuilder() {
+
+ }
+
+ @Override
+ public DialChart build() {
+
+ return new DialChart(this);
+ }
+}
diff --git a/xchart/src/main/java/org/knowm/xchart/DialSeries.java b/xchart/src/main/java/org/knowm/xchart/DialSeries.java
new file mode 100644
index 000000000..c7251bc04
--- /dev/null
+++ b/xchart/src/main/java/org/knowm/xchart/DialSeries.java
@@ -0,0 +1,175 @@
+/**
+ * Copyright 2015-2017 Knowm Inc. (http://knowm.org) and contributors.
+ * Copyright 2011-2015 Xeiam LLC (http://xeiam.com) and contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.knowm.xchart;
+
+import java.awt.BasicStroke;
+import java.awt.Color;
+
+import org.knowm.xchart.internal.chartpart.RenderableSeries.LegendRenderType;
+import org.knowm.xchart.internal.series.Series;
+import org.knowm.xchart.style.markers.Marker;
+
+/**
+ * A Series containing Radar data to be plotted on a Chart
+ *
+ * @author timmolter
+ */
+public class DialSeries extends Series {
+
+ /**
+ * Line Style
+ */
+ private BasicStroke stroke;
+
+ /**
+ * Line Color
+ */
+ private Color lineColor;
+
+ /**
+ * Line Width
+ */
+ private float lineWidth;
+
+ /**
+ * Marker
+ */
+ private Marker marker;
+
+ /**
+ * Marker Color
+ */
+ private Color markerColor;
+
+ private double value;
+ private String toolTip;
+
+ /**
+ * @param toolTips Adds custom tool tips for series. If tool tip is null, it is automatically calculated.
+ */
+ public DialSeries(String name, double value, String toolTip) {
+
+ super(name);
+ this.value = value;
+ this.toolTip = toolTip;
+ }
+
+ public double getValue() {
+
+ return value;
+ }
+
+ public void setValue(double value) {
+
+ this.value = value;
+ }
+
+ public String getToolTip() {
+
+ return toolTip;
+ }
+
+ /**
+ * Set the line style of the series
+ *
+ * @param basicStroke
+ */
+ public DialSeries setLineStyle(BasicStroke basicStroke) {
+
+ stroke = basicStroke;
+ if (this.lineWidth > 0.0f) {
+ stroke = new BasicStroke(lineWidth, this.stroke.getEndCap(), this.stroke.getLineJoin(), this.stroke.getMiterLimit(), this.stroke.getDashArray(), this.stroke.getDashPhase());
+ }
+ return this;
+ }
+
+ /**
+ * Set the line color of the series
+ *
+ * @param color
+ */
+ public DialSeries setLineColor(java.awt.Color color) {
+
+ this.lineColor = color;
+ return this;
+ }
+
+ /**
+ * Set the line width of the series
+ *
+ * @param lineWidth
+ */
+ public DialSeries setLineWidth(float lineWidth) {
+
+ this.lineWidth = lineWidth;
+ return this;
+ }
+
+ /**
+ * Sets the marker for the series
+ *
+ * @param marker
+ */
+ public DialSeries setMarker(Marker marker) {
+
+ this.marker = marker;
+ return this;
+ }
+
+ /**
+ * Sets the marker color for the series
+ *
+ * @param color
+ */
+ public DialSeries setMarkerColor(java.awt.Color color) {
+
+ this.markerColor = color;
+ return this;
+ }
+
+ public BasicStroke getLineStyle() {
+
+ return stroke;
+ }
+
+ public Color getLineColor() {
+
+ return lineColor;
+ }
+
+ public float getLineWidth() {
+
+ return lineWidth;
+ }
+
+ public Marker getMarker() {
+
+ return marker;
+ }
+
+ public Color getMarkerColor() {
+
+ return markerColor;
+ }
+
+ @Override
+ public LegendRenderType getLegendRenderType() {
+
+ // Pie charts are always rendered as a Box in the legend
+ return null;
+ }
+}
diff --git a/xchart/src/main/java/org/knowm/xchart/XChartPanel.java b/xchart/src/main/java/org/knowm/xchart/XChartPanel.java
index 5404780a6..0447d1c6a 100644
--- a/xchart/src/main/java/org/knowm/xchart/XChartPanel.java
+++ b/xchart/src/main/java/org/knowm/xchart/XChartPanel.java
@@ -35,7 +35,6 @@
import javax.swing.JPanel;
import javax.swing.JPopupMenu;
import javax.swing.KeyStroke;
-import javax.swing.UIDefaults;
import javax.swing.UIManager;
import javax.swing.filechooser.FileFilter;
@@ -220,7 +219,7 @@ private void showExportAsDialog() {
UIManager.put("FileChooser.saveButtonText", "Export");
UIManager.put("FileChooser.fileNameLabelText", "Export To:");
UIManager.put("FileChooser.saveDialogFileNameLabel.textAndMnemonic", "Export To:");
- UIDefaults defaults = UIManager.getDefaults();
+// UIDefaults defaults = UIManager.getDefaults();
// System.out.println(defaults.size()+ " properties");
// for (Enumeration e = defaults.keys();
// e.hasMoreElements();) {
diff --git a/xchart/src/main/java/org/knowm/xchart/internal/chartpart/PlotContent_Dial.java b/xchart/src/main/java/org/knowm/xchart/internal/chartpart/PlotContent_Dial.java
new file mode 100644
index 000000000..ebc79593f
--- /dev/null
+++ b/xchart/src/main/java/org/knowm/xchart/internal/chartpart/PlotContent_Dial.java
@@ -0,0 +1,284 @@
+/**
+ * Copyright 2015-2017 Knowm Inc. (http://knowm.org) and contributors.
+ * Copyright 2011-2015 Xeiam LLC (http://xeiam.com) and contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.knowm.xchart.internal.chartpart;
+
+import java.awt.Color;
+import java.awt.Graphics2D;
+import java.awt.Shape;
+import java.awt.font.FontRenderContext;
+import java.awt.font.TextLayout;
+import java.awt.geom.AffineTransform;
+import java.awt.geom.Line2D;
+import java.awt.geom.Path2D;
+import java.awt.geom.Rectangle2D;
+import java.text.DecimalFormat;
+import java.text.NumberFormat;
+import java.util.Map;
+
+import org.knowm.xchart.DialSeries;
+import org.knowm.xchart.internal.series.Series;
+import org.knowm.xchart.style.DialStyler;
+import org.knowm.xchart.style.Styler;
+
+public class PlotContent_Dial extends PlotContent_ {
+
+ private final DialStyler styler;
+ private final NumberFormat df = DecimalFormat.getPercentInstance();
+
+ PlotContent_Dial(Chart chart) {
+
+ super(chart);
+ styler = chart.getStyler();
+ }
+
+ @Override
+ public void doPaint(Graphics2D g) {
+
+ double pieFillPercentage = styler.getPlotContentSize();
+
+ double halfBorderPercentage = (1 - pieFillPercentage) / 2.0;
+ double boundsWidth = getBounds().getWidth();
+ double boundsHeight = getBounds().getHeight();
+ double min = Math.min(boundsWidth, boundsHeight);
+ double width = styler.isCircular() ? min : boundsWidth;
+ double height = styler.isCircular() ? min : boundsHeight;
+
+ // we need to adjust height when arcAngle is small. To much wasted space on buttom of the chart
+ // Not sure but something like r += r - cos((360-arcAngle)/2) where r is vertical radius
+
+
+ Rectangle2D pieBounds = new Rectangle2D.Double(
+
+ getBounds().getX() + boundsWidth / 2 - width / 2 + halfBorderPercentage * width,
+
+ getBounds().getY() + boundsHeight / 2 - height / 2 + halfBorderPercentage * height,
+
+ width * pieFillPercentage,
+
+ height * pieFillPercentage);
+
+ // get total
+ boolean axisTickLabelsVisible = styler.isAxisTickLabelsVisible();
+ double arcAngle = styler.getArcAngle();
+ double donutThickness = styler.getDonutThickness();
+ int axisTitlePadding = styler.getAxisTitlePadding();
+
+ double[] axisTickValues = styler.getAxisTickValues();
+ int markCount = axisTickValues.length;
+ String[] axisTickLabels = styler.getAxisTickLabels();
+
+ double[] fromArr = { styler.getNormalFrom(), styler.getGreenFrom(), styler.getRedFrom() };
+ double[] toArr = { styler.getNormalTo(), styler.getGreenTo(), styler.getRedTo() };
+ Color[] donutColorArr = { styler.getNormalColor(), styler.getGreenColor(), styler.getRedColor() };
+
+ double dountStartAngle = (arcAngle) / 2 + 90;
+ // draw shape
+ for (int i = 0; i < donutColorArr.length; i++) {
+ double from = fromArr[i];
+ double to = toArr[i];
+ if (to <= from || to < 0 || from < 0) {
+ continue;
+ }
+ double totalAngle = (to - from) * arcAngle;
+ double startAngle = dountStartAngle - from * arcAngle - totalAngle;
+ Shape donutSlice = PlotContent_Pie.getDonutSliceShape(pieBounds, donutThickness, startAngle, totalAngle);
+ g.setColor(donutColorArr[i]);
+ g.fill(donutSlice);
+ g.draw(donutSlice);
+ }
+
+ double xDiameter = pieBounds.getWidth() / 2;
+ double yDiameter = pieBounds.getHeight() / 2;
+
+ double xCenter = pieBounds.getX() + xDiameter;
+ double yCenter = pieBounds.getY() + yDiameter;
+
+ if (markCount > 0 && styler.isAxisTicksMarksVisible()) {
+ g.setColor(styler.getAxisTickMarksColor());
+ g.setStroke(styler.getAxisTickMarksStroke());
+
+ for (int i = 0; i < markCount; i++) {
+ double angle = -axisTickValues[i] * arcAngle + (arcAngle) / 2 + 90;
+ double radians = Math.toRadians(angle);
+ double cos = Math.cos(radians);
+ double sin = Math.sin(radians);
+
+ double xOffset = xCenter + cos * xDiameter;
+ double yOffset = yCenter - sin * yDiameter;
+ double xOffset2 = xCenter + cos * xDiameter * (1 - donutThickness);
+ double yOffset2 = yCenter - sin * yDiameter * (1 - donutThickness);
+
+ Line2D.Double line = new Line2D.Double(xOffset2, yOffset2, xOffset, yOffset);
+ g.setColor(styler.getAxisTickMarksColor());
+ g.setStroke(styler.getAxisTickMarksStroke());
+ g.draw(line);
+
+ if (!axisTickLabelsVisible) {
+ continue;
+ }
+ String annotation = axisTickLabels[i];
+
+ TextLayout textLayout = new TextLayout(annotation, styler.getAxisTitleFont(),
+ new FontRenderContext(null, true, false));
+ Shape shape = textLayout.getOutline(null);
+
+ Rectangle2D annotationBounds = shape.getBounds2D();
+ double annotationWidth = annotationBounds.getWidth();
+ double annotationHeight = annotationBounds.getHeight();
+
+ // calculate corrections
+ double xc;
+ double yc = 0;
+ if (axisTickValues[i] < 0.49) {
+ xc = 0;
+ } else if (axisTickValues[i] > 0.51) {
+ xc = -annotationWidth;
+ } else {
+ xc = -annotationWidth / 2;
+ yc = annotationHeight / 2;
+ }
+ xOffset2 = xCenter + cos * (xDiameter - axisTitlePadding) * (1 - donutThickness);
+ yOffset2 = yCenter - sin * (yDiameter - axisTitlePadding) * (1 - donutThickness);
+
+ double tx = xOffset2 + xc;
+ double ty = yOffset2 + yc + annotationHeight / 2;
+
+ g.setColor(styler.getChartFontColor());
+ g.setFont(styler.getAnnotationsFont());
+ AffineTransform orig = g.getTransform();
+ AffineTransform at = new AffineTransform();
+
+ at.translate(tx, ty);
+
+ g.transform(at);
+ g.fill(shape);
+ g.setTransform(orig);
+ }
+ }
+
+ Map map = chart.getSeriesMap();
+ for (DialSeries series : map.values()) {
+ if (!series.isEnabled()) {
+ continue;
+ }
+
+ // draw title
+ if (styler.isAxisTitleVisible()) {
+ TextLayout textLayout = new TextLayout(series.getName(), styler.getAxisTitleFont(),
+ new FontRenderContext(null, true, false));
+ Shape shape = textLayout.getOutline(null);
+
+ Rectangle2D annotationBounds = shape.getBounds2D();
+ double annotationWidth = annotationBounds.getWidth();
+ double annotationHeight = annotationBounds.getHeight();
+
+ // calculate corrections
+ double tx = xCenter - annotationWidth / 2;
+ double ty = yCenter - yDiameter / 2 + annotationHeight / 2;
+
+ g.setColor(styler.getChartFontColor());
+ g.setFont(styler.getAxisTitleFont());
+ AffineTransform orig = g.getTransform();
+ AffineTransform at = new AffineTransform();
+
+ at.translate(tx, ty);
+
+ g.transform(at);
+ g.fill(shape);
+ g.setTransform(orig);
+ }
+
+ double value = series.getValue();
+ // draw title
+ if (styler.hasAnnotations()) {
+ String annotation = series.getToolTip();
+ if (annotation == null) {
+ if (styler.getDecimalPattern() != null) {
+ DecimalFormat df = new DecimalFormat(styler.getDecimalPattern());
+ annotation = df.format(value);
+ } else {
+ annotation = df.format(value);
+ }
+ }
+ if (!annotation.isEmpty()) {
+ TextLayout textLayout = new TextLayout(annotation, styler.getAnnotationsFont(),
+ new FontRenderContext(null, true, false));
+ Shape shape = textLayout.getOutline(null);
+
+ Rectangle2D annotationBounds = shape.getBounds2D();
+ double annotationWidth = annotationBounds.getWidth();
+ double annotationHeight = annotationBounds.getHeight();
+
+ double tx = xCenter - annotationWidth / 2;
+ double ty = yCenter + yDiameter / 2 - annotationHeight / 2;
+
+ g.setColor(styler.getChartFontColor());
+ g.setFont(styler.getAxisTitleFont());
+ AffineTransform orig = g.getTransform();
+ AffineTransform at = new AffineTransform();
+
+ at.translate(tx, ty);
+
+ g.transform(at);
+ g.fill(shape);
+ g.setTransform(orig);
+ }
+ }
+
+ // draw arrow
+ double angle = -value * arcAngle + (arcAngle) / 2 + 90;
+
+ double radians = Math.toRadians(angle);
+ double arrowLengthPercentage = styler.getArrowLengthPercentage();
+ double arrowArcAngle = styler.getArrowArcAngle();
+ double arrowArcPercentage = styler.getArrowArcPercentage();
+ double xOffset = xCenter + Math.cos(radians) * (xDiameter * arrowLengthPercentage);
+ double yOffset = yCenter - Math.sin(radians) * (yDiameter * arrowLengthPercentage);
+
+ Path2D.Double path = new Path2D.Double();
+ if (styler.isToolTipsEnabled()) {
+ String annotation = series.getToolTip();
+ if (annotation == null) {
+ if (styler.getDecimalPattern() != null) {
+ DecimalFormat df = new DecimalFormat(styler.getDecimalPattern());
+ annotation = df.format(value);
+ } else {
+ annotation = df.format(value);
+ }
+ }
+ chart.toolTips.addData(path, xOffset, yOffset + 10, 0, annotation);
+ }
+ path.moveTo(xCenter, yCenter);
+
+ double[][] angleValues = { { -arrowArcAngle, arrowArcPercentage }, { 0, 1 }, { arrowArcAngle, arrowArcPercentage } };
+ for (double[] ds : angleValues) {
+ radians = Math.toRadians(angle - ds[0]);
+
+ double diameterPerct = arrowLengthPercentage * ds[1];
+ xOffset = xCenter + Math.cos(radians) * (xDiameter * diameterPerct);
+ yOffset = yCenter - Math.sin(radians) * (yDiameter * diameterPerct);
+ path.lineTo(xOffset, yOffset);
+ }
+
+ path.closePath();
+ g.setColor(series.getFillColor());
+ g.fill(path);
+ g.setColor(series.getLineColor());
+ g.draw(path);
+ }
+ }
+}
diff --git a/xchart/src/main/java/org/knowm/xchart/internal/chartpart/PlotContent_Pie.java b/xchart/src/main/java/org/knowm/xchart/internal/chartpart/PlotContent_Pie.java
index 8d619611a..e21b82aa0 100644
--- a/xchart/src/main/java/org/knowm/xchart/internal/chartpart/PlotContent_Pie.java
+++ b/xchart/src/main/java/org/knowm/xchart/internal/chartpart/PlotContent_Pie.java
@@ -289,20 +289,25 @@ public void doPaint(Graphics2D g) {
}
}
- private Shape getDonutSliceShape(Rectangle2D pieBounds, double thickness, double start, double extent) {
+ public static Shape getDonutSliceShape(Rectangle2D pieBounds, double thickness, double start, double extent) {
thickness = thickness / 2;
GeneralPath generalPath = new GeneralPath();
GeneralPath dummy = new GeneralPath(); // used to find arc endpoints
- Shape outer = new Arc2D.Double(pieBounds.getX(), pieBounds.getY(), pieBounds.getWidth(), pieBounds.getHeight(), start, extent, Arc2D.OPEN);
- Shape inner = new Arc2D.Double(pieBounds.getX() + pieBounds.getWidth() * thickness, pieBounds.getY() + pieBounds.getHeight() * thickness, pieBounds.getWidth() - 2 * pieBounds.getWidth()
- * thickness, pieBounds.getHeight() - 2 * pieBounds.getHeight() * thickness, start + extent, -extent, Arc2D.OPEN);
+ double x = pieBounds.getX();
+ double y = pieBounds.getY();
+ double width = pieBounds.getWidth();
+ double height = pieBounds.getHeight();
+ Shape outer = new Arc2D.Double(x, y, width, height, start, extent, Arc2D.OPEN);
+ double wt = width * thickness;
+ double ht = height * thickness;
+ Shape inner = new Arc2D.Double(x + wt, y + ht, width - 2 * wt, height - 2 * ht, start + extent, -extent,
+ Arc2D.OPEN);
generalPath.append(outer, false);
- dummy.append(new Arc2D.Double(pieBounds.getX() + pieBounds.getWidth() * thickness, pieBounds.getY() + pieBounds.getHeight() * thickness, pieBounds.getWidth() - 2 * pieBounds.getWidth()
- * thickness, pieBounds.getHeight() - 2 * pieBounds.getHeight() * thickness, start, extent, Arc2D.OPEN), false);
+ dummy.append(new Arc2D.Double(x + wt, y + ht, width - 2 * wt, height - 2 * ht, start, extent, Arc2D.OPEN), false);
Point2D point = dummy.getCurrentPoint();
@@ -311,10 +316,11 @@ private Shape getDonutSliceShape(Rectangle2D pieBounds, double thickness, double
}
generalPath.append(inner, false);
- dummy.append(new Arc2D.Double(pieBounds.getX(), pieBounds.getY(), pieBounds.getWidth(), pieBounds.getHeight(), start + extent, -extent, Arc2D.OPEN), false);
+ dummy.append(new Arc2D.Double(x, y, width, height, start + extent, -extent, Arc2D.OPEN), false);
point = dummy.getCurrentPoint();
generalPath.lineTo(point.getX(), point.getY());
return generalPath;
}
+
}
diff --git a/xchart/src/main/java/org/knowm/xchart/internal/chartpart/PlotSurface_Pie.java b/xchart/src/main/java/org/knowm/xchart/internal/chartpart/PlotSurface_Pie.java
index dac8694e6..1a161837a 100644
--- a/xchart/src/main/java/org/knowm/xchart/internal/chartpart/PlotSurface_Pie.java
+++ b/xchart/src/main/java/org/knowm/xchart/internal/chartpart/PlotSurface_Pie.java
@@ -20,9 +20,7 @@
import java.awt.Shape;
import java.awt.geom.Rectangle2D;
-import org.knowm.xchart.PieSeries;
import org.knowm.xchart.internal.series.Series;
-import org.knowm.xchart.style.PieStyler;
import org.knowm.xchart.style.Styler;
/**
@@ -32,17 +30,17 @@
*/
public class PlotSurface_Pie extends PlotSurface_ {
- private final PieStyler stylerPie;
+ private final Styler styler;
/**
* Constructor
*
* @param chart
*/
- PlotSurface_Pie(Chart chart) {
+ PlotSurface_Pie(Chart extends Styler, ? extends Series> chart) {
super(chart);
- this.stylerPie = chart.getStyler();
+ this.styler = chart.getStyler();
}
@Override
@@ -52,12 +50,12 @@ public void paint(Graphics2D g) {
// paint plot background
Shape rect = new Rectangle2D.Double(bounds.getX(), bounds.getY(), bounds.getWidth(), bounds.getHeight());
- g.setColor(stylerPie.getPlotBackgroundColor());
+ g.setColor(styler.getPlotBackgroundColor());
g.fill(rect);
// paint plot border
- if (stylerPie.isPlotBorderVisible()) {
- g.setColor(stylerPie.getPlotBorderColor());
+ if (styler.isPlotBorderVisible()) {
+ g.setColor(styler.getPlotBorderColor());
// g.setStroke(getChartPainter().getstyler().getAxisTickMarksStroke());
g.draw(rect);
}
diff --git a/xchart/src/main/java/org/knowm/xchart/internal/chartpart/PlotSurface_Radar.java b/xchart/src/main/java/org/knowm/xchart/internal/chartpart/PlotSurface_Radar.java
deleted file mode 100644
index 4dcd0f89d..000000000
--- a/xchart/src/main/java/org/knowm/xchart/internal/chartpart/PlotSurface_Radar.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/**
- * Copyright 2015-2017 Knowm Inc. (http://knowm.org) and contributors.
- * Copyright 2011-2015 Xeiam LLC (http://xeiam.com) and contributors.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.knowm.xchart.internal.chartpart;
-
-import java.awt.Graphics2D;
-import java.awt.Shape;
-import java.awt.geom.Rectangle2D;
-
-import org.knowm.xchart.RadarSeries;
-import org.knowm.xchart.internal.series.Series;
-import org.knowm.xchart.style.RadarStyler;
-import org.knowm.xchart.style.Styler;
-
-/**
- * Draws the plot background and the plot border
- */
-public class PlotSurface_Radar extends PlotSurface_ {
-
- private final RadarStyler stylerRadar;
-
- /**
- * Constructor
- *
- * @param chart
- */
- PlotSurface_Radar(Chart chart) {
-
- super(chart);
- this.stylerRadar = chart.getStyler();
- }
-
- @Override
- public void paint(Graphics2D g) {
-
- Rectangle2D bounds = getBounds();
-
- // paint plot background
- Shape rect = new Rectangle2D.Double(bounds.getX(), bounds.getY(), bounds.getWidth(), bounds.getHeight());
- g.setColor(stylerRadar.getPlotBackgroundColor());
- g.fill(rect);
-
- // paint plot border
- if (stylerRadar.isPlotBorderVisible()) {
- g.setColor(stylerRadar.getPlotBorderColor());
- // g.setStroke(getChartPainter().getstyler().getAxisTickMarksStroke());
- g.draw(rect);
- }
- }
-}
diff --git a/xchart/src/main/java/org/knowm/xchart/internal/chartpart/Plot_Dial.java b/xchart/src/main/java/org/knowm/xchart/internal/chartpart/Plot_Dial.java
new file mode 100644
index 000000000..419342e08
--- /dev/null
+++ b/xchart/src/main/java/org/knowm/xchart/internal/chartpart/Plot_Dial.java
@@ -0,0 +1,43 @@
+/**
+ * Copyright 2015-2017 Knowm Inc. (http://knowm.org) and contributors.
+ * Copyright 2011-2015 Xeiam LLC (http://xeiam.com) and contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.knowm.xchart.internal.chartpart;
+
+import org.knowm.xchart.DialSeries;
+import org.knowm.xchart.internal.series.Series;
+import org.knowm.xchart.style.DialStyler;
+import org.knowm.xchart.style.Styler;
+
+public class Plot_Dial extends Plot_Pie {
+
+ /**
+ * Constructor
+ *
+ * @param chart
+ */
+ public Plot_Dial(Chart chart) {
+
+ super((Chart) chart);
+ }
+
+ @Override
+ protected void initContentAndSurface(Chart chart) {
+
+ this.plotContent = new PlotContent_Dial(chart);
+ this.plotSurface = new PlotSurface_Pie(chart);
+ }
+
+}
diff --git a/xchart/src/main/java/org/knowm/xchart/internal/chartpart/Plot_Pie.java b/xchart/src/main/java/org/knowm/xchart/internal/chartpart/Plot_Pie.java
index 0e95e3907..0dc157974 100644
--- a/xchart/src/main/java/org/knowm/xchart/internal/chartpart/Plot_Pie.java
+++ b/xchart/src/main/java/org/knowm/xchart/internal/chartpart/Plot_Pie.java
@@ -35,11 +35,16 @@ public class Plot_Pie extends Plot_ {
*
* @param chart
*/
- public Plot_Pie(Chart chart) {
+ public Plot_Pie(Chart chart) {
super(chart);
- this.plotContent = new PlotContent_Pie(chart);
- this.plotSurface = new PlotSurface_Pie(chart);
+ initContentAndSurface(chart);
+ }
+
+ protected void initContentAndSurface(Chart chart) {
+
+ this.plotContent = new PlotContent_Pie((Chart) chart);
+ this.plotSurface = new PlotSurface_Pie((Chart) chart);
}
@Override
diff --git a/xchart/src/main/java/org/knowm/xchart/internal/chartpart/Plot_Radar.java b/xchart/src/main/java/org/knowm/xchart/internal/chartpart/Plot_Radar.java
index 49b6154be..5a115c205 100644
--- a/xchart/src/main/java/org/knowm/xchart/internal/chartpart/Plot_Radar.java
+++ b/xchart/src/main/java/org/knowm/xchart/internal/chartpart/Plot_Radar.java
@@ -16,16 +16,12 @@
*/
package org.knowm.xchart.internal.chartpart;
-import java.awt.Graphics2D;
-import java.awt.geom.Rectangle2D;
-
import org.knowm.xchart.RadarSeries;
import org.knowm.xchart.internal.series.Series;
import org.knowm.xchart.style.RadarStyler;
import org.knowm.xchart.style.Styler;
-import org.knowm.xchart.style.Styler.LegendPosition;
-public class Plot_Radar extends Plot_ {
+public class Plot_Radar extends Plot_Pie {
/**
* Constructor
@@ -34,34 +30,14 @@ public class Plot_Radar extends Plot_ {
*/
public Plot_Radar(Chart chart) {
- super(chart);
- this.plotContent = new PlotContent_Radar(chart);
- this.plotSurface = new PlotSurface_Radar(chart);
+ super((Chart) chart);
}
@Override
- public void paint(Graphics2D g) {
-
- // calculate bounds
- double xOffset = chart.getStyler().getChartPadding();
-
- // double yOffset = chart.getChartTitle().getBounds().getHeight() + 2 * chart.getStyler().getChartPadding();
- double yOffset = chart.getChartTitle().getBounds().getHeight() + chart.getStyler().getChartPadding();
-
- double width =
-
- chart.getWidth()
-
- - (chart.getStyler().getLegendPosition() == LegendPosition.OutsideE ? chart.getLegend().getBounds().getWidth() : 0)
-
- - 2 * chart.getStyler().getChartPadding()
-
- - (chart.getStyler().getLegendPosition() == LegendPosition.OutsideE && chart.getStyler().isLegendVisible() ? chart.getStyler().getChartPadding() : 0);
-
- double height = chart.getHeight() - chart.getChartTitle().getBounds().getHeight() - 2 * chart.getStyler().getChartPadding();
-
- this.bounds = new Rectangle2D.Double(xOffset, yOffset, width, height);
-
- super.paint(g);
+ protected void initContentAndSurface(Chart chart) {
+
+ this.plotContent = new PlotContent_Radar(chart);
+ this.plotSurface = new PlotSurface_Pie(chart);
}
+
}
diff --git a/xchart/src/main/java/org/knowm/xchart/style/DialStyler.java b/xchart/src/main/java/org/knowm/xchart/style/DialStyler.java
new file mode 100644
index 000000000..96e6d0eb0
--- /dev/null
+++ b/xchart/src/main/java/org/knowm/xchart/style/DialStyler.java
@@ -0,0 +1,345 @@
+/**
+ * Copyright 2015-2017 Knowm Inc. (http://knowm.org) and contributors.
+ * Copyright 2011-2015 Xeiam LLC (http://xeiam.com) and contributors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.knowm.xchart.style;
+
+import java.awt.Color;
+import java.awt.Font;
+import java.awt.Stroke;
+
+/**
+ * @author timmolter
+ */
+public class DialStyler extends Styler {
+
+ private boolean isCircular;
+
+ // helper tick lines
+ private boolean axisTicksMarksVisible;
+ private Color axisTickMarksColor;
+ private Stroke axisTickMarksStroke;
+ private double[] axisTickValues = { 0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1 };
+ private String[] axisTickLabels = { "0", "10", "20", "30", "40", "50", "60", "70", "80", "90", "100" };
+
+ // variable labels
+ private boolean axisTitleVisible;
+ private Font axisTitleFont;
+ private int axisTitlePadding;
+ private boolean axisTickLabelsVisible = true;
+
+ // donut area
+ private double arcAngle = 270;
+ private double donutThickness = .11;
+
+ private double normalFrom = 0;
+ private double normalTo = 1;
+ private Color normalColor = Color.LIGHT_GRAY;
+
+ private double greenFrom = 0;
+ private double greenTo = 0.2;
+ private Color greenColor = Color.GREEN;
+
+ private double redFrom = 0.8;
+ private double redTo = 1;
+ private Color redColor = Color.RED;
+
+ //
+ private double arrowLengthPercentage = 0.85;
+ private double arrowArcAngle = 20;
+ private double arrowArcPercentage = 0.15;
+
+ public DialStyler() {
+
+ this.setAllStyles();
+ super.setAllStyles();
+ }
+
+ @Override
+ void setAllStyles() {
+
+ this.isCircular = theme.isCircular();
+
+ // Annotations ////////////////////////////////
+ this.hasAnnotations = true;
+
+ this.axisTickMarksColor = theme.getAxisTickMarksColor();
+ this.axisTickMarksStroke = theme.getAxisTickMarksStroke();
+ this.axisTicksMarksVisible = theme.isAxisTicksMarksVisible();
+
+ this.axisTitleVisible = theme.isXAxisTitleVisible() || theme.isYAxisTitleVisible();
+ this.axisTitleFont = theme.getAxisTitleFont();
+ this.axisTitlePadding = theme.getAxisTitlePadding();
+ }
+
+ public boolean isCircular() {
+
+ return isCircular;
+ }
+
+ /**
+ * Sets whether or not the radar chart is forced to be circular. Otherwise
+ * it's shape is oval, matching the containing plot.
+ *
+ * @param isCircular
+ */
+ public DialStyler setCircular(boolean isCircular) {
+
+ this.isCircular = isCircular;
+ return this;
+ }
+
+ /**
+ * Set the theme the styler should use
+ *
+ * @param theme
+ */
+ public DialStyler setTheme(Theme theme) {
+
+ this.theme = theme;
+ super.setAllStyles();
+ return this;
+ }
+
+ public boolean isAxisTicksMarksVisible() {
+
+ return axisTicksMarksVisible;
+ }
+
+ public void setAxisTicksMarksVisible(boolean axisTicksMarksVisible) {
+
+ this.axisTicksMarksVisible = axisTicksMarksVisible;
+ }
+
+ public Color getAxisTickMarksColor() {
+
+ return axisTickMarksColor;
+ }
+
+ public void setAxisTickMarksColor(Color axisTickMarksColor) {
+
+ this.axisTickMarksColor = axisTickMarksColor;
+ }
+
+ public Stroke getAxisTickMarksStroke() {
+
+ return axisTickMarksStroke;
+ }
+
+ public void setAxisTickMarksStroke(Stroke axisTickMarksStroke) {
+
+ this.axisTickMarksStroke = axisTickMarksStroke;
+ }
+
+ public boolean isAxisTitleVisible() {
+
+ return axisTitleVisible;
+ }
+
+ public void setAxisTitleVisible(boolean axisTitleVisible) {
+
+ this.axisTitleVisible = axisTitleVisible;
+ }
+
+ public Font getAxisTitleFont() {
+
+ return axisTitleFont;
+ }
+
+ public void setAxisTitleFont(Font axisTitleFont) {
+
+ this.axisTitleFont = axisTitleFont;
+ }
+
+ public int getAxisTitlePadding() {
+
+ return axisTitlePadding;
+ }
+
+ public void setAxisTitlePadding(int axisTitlePadding) {
+
+ this.axisTitlePadding = axisTitlePadding;
+ }
+
+ public double[] getAxisTickValues() {
+
+ return axisTickValues;
+ }
+
+ public void setAxisTickValues(double[] axisTickValues) {
+
+ this.axisTickValues = axisTickValues;
+ }
+
+ public String[] getAxisTickLabels() {
+
+ return axisTickLabels;
+ }
+
+ public void setAxisTickLabels(String[] axisTickLabels) {
+
+ this.axisTickLabels = axisTickLabels;
+ }
+
+ public double getNormalFrom() {
+
+ return normalFrom;
+ }
+
+ public void setNormalFrom(double normalFrom) {
+
+ this.normalFrom = normalFrom;
+ }
+
+ public double getNormalTo() {
+
+ return normalTo;
+ }
+
+ public void setNormalTo(double normalTo) {
+
+ this.normalTo = normalTo;
+ }
+
+ public Color getNormalColor() {
+
+ return normalColor;
+ }
+
+ public void setNormalColor(Color normalColor) {
+
+ this.normalColor = normalColor;
+ }
+
+ public double getGreenFrom() {
+
+ return greenFrom;
+ }
+
+ public void setGreenFrom(double greenFrom) {
+
+ this.greenFrom = greenFrom;
+ }
+
+ public double getGreenTo() {
+
+ return greenTo;
+ }
+
+ public void setGreenTo(double greenTo) {
+
+ this.greenTo = greenTo;
+ }
+
+ public Color getGreenColor() {
+
+ return greenColor;
+ }
+
+ public void setGreenColor(Color greenColor) {
+
+ this.greenColor = greenColor;
+ }
+
+ public double getRedFrom() {
+
+ return redFrom;
+ }
+
+ public void setRedFrom(double redFrom) {
+
+ this.redFrom = redFrom;
+ }
+
+ public double getRedTo() {
+
+ return redTo;
+ }
+
+ public void setRedTo(double redTo) {
+
+ this.redTo = redTo;
+ }
+
+ public Color getRedColor() {
+
+ return redColor;
+ }
+
+ public void setRedColor(Color redColor) {
+
+ this.redColor = redColor;
+ }
+
+ public double getArcAngle() {
+
+ return arcAngle;
+ }
+
+ public void setArcAngle(double arcAngle) {
+
+ this.arcAngle = arcAngle;
+ }
+
+ public boolean isAxisTickLabelsVisible() {
+
+ return axisTickLabelsVisible;
+ }
+
+ public void setAxisTickLabelsVisible(boolean axisTickLabelsVisible) {
+
+ this.axisTickLabelsVisible = axisTickLabelsVisible;
+ }
+
+ public double getDonutThickness() {
+
+ return donutThickness;
+ }
+
+ public void setDonutThickness(double donutThickness) {
+
+ this.donutThickness = donutThickness;
+ }
+
+ public double getArrowLengthPercentage() {
+
+ return arrowLengthPercentage;
+ }
+
+ public void setArrowLengthPercentage(double arrowLengthPercentage) {
+
+ this.arrowLengthPercentage = arrowLengthPercentage;
+ }
+
+ public double getArrowArcAngle() {
+
+ return arrowArcAngle;
+ }
+
+ public void setArrowArcAngle(double arrowArcAngle) {
+
+ this.arrowArcAngle = arrowArcAngle;
+ }
+
+ public double getArrowArcPercentage() {
+
+ return arrowArcPercentage;
+ }
+
+ public void setArrowArcPercentage(double arrowArcPercentage) {
+
+ this.arrowArcPercentage = arrowArcPercentage;
+ }
+}