Skip to content
Snippets Groups Projects
Commit 1f21d270 authored by Tim Molter's avatar Tim Molter
Browse files

legend - don't show line for scatter charts

parent 1380882d
No related branches found
No related tags found
No related merge requests found
......@@ -23,6 +23,7 @@ import com.xeiam.xchart.Chart;
import com.xeiam.xchart.SwingWrapper;
import com.xeiam.xchart.demo.charts.ExampleChart;
import com.xeiam.xchart.style.StyleManager.ChartType;
import com.xeiam.xchart.style.StyleManager.LegendPosition;
/**
* Gaussian Blob
......@@ -56,8 +57,7 @@ public class ScatterChart01 implements ExampleChart {
// Customize Chart
chart.getStyleManager().setChartTitleVisible(false);
chart.getStyleManager().setLegendVisible(false);
chart.getStyleManager().setLegendPosition(LegendPosition.InsideSW);
// Series
chart.addSeries("Gaussian Blob", xData, yData);
......
......@@ -159,12 +159,14 @@ public class Legend implements ChartPart {
Series series = seriesMap.get(seriesId);
if (getChart().getStyleManager().getChartType() != ChartType.Bar) {
// paint line
if (series.getStroke() != null) {
if (getChart().getStyleManager().getChartType() != ChartType.Scatter && series.getStroke() != null) {
g.setColor(series.getStrokeColor());
g.setStroke(series.getStroke());
g.drawLine(startx, starty + (int) (maxContentHeight / 2.0), (int) (startx + Marker.SIZE * 3.0), starty + (int) (maxContentHeight / 2.0));
}
// paint marker
if (series.getMarker() != null) {
g.setColor(series.getMarkerColor());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment