Skip to content

Commit db05229

Browse files
JonanOribeBennuFirenielsdejong
authored
Scatter plot (#341)
* Scatter plot Add advanced setting to line charts to turn it into a scatter plot * Scatter plot Add advanced setting to line charts to turn it into a scatter plot * Added docs and refactored settings retrieval --------- Co-authored-by: Harold Agudelo <[email protected]> Co-authored-by: Niels de Jong <[email protected]>
1 parent 7df57ea commit db05229

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

docs/modules/ROOT/pages/user-guide/reports/line-chart.adoc

+2
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ image::line2.png[Multi Line Chart]
4545
[width="100%",cols="13%,2%,6%,79%",options="header",]
4646
|===
4747
|Name |Type |Default Value |Description
48+
|Plot Type |List |line | Whether to use a line plot (with connections) or a scatter plot of disjointed points
49+
4850
|Show Legend |on/off |off |If enabled, shows a legend at the top right
4951
of the visualization.
5052

src/chart/line/LineChart.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ const NeoLineChart = (props: ChartProps) => {
4545
const marginLeft = settings.marginLeft ? settings.marginLeft : 36;
4646
const marginTop = settings.marginTop ? settings.marginTop : 24;
4747
const marginBottom = settings.marginBottom ? settings.marginBottom : 40;
48-
const lineWidth = settings.lineWidth ? settings.lineWidth : 2;
48+
const lineWidth = settings.type == 'scatter' ? 0 : settings.lineWidth || 2;
4949
const pointSize = settings.pointSize ? settings.pointSize : 10;
5050
const showGrid = settings.showGrid != undefined ? settings.showGrid : true;
5151
const xTickValues = settings.xTickValues != undefined ? settings.xTickValues : undefined;

src/config/ReportConfig.tsx

+6
Original file line numberDiff line numberDiff line change
@@ -636,6 +636,12 @@ export const REPORT_TYPES = {
636636
},
637637
maxRecords: 250,
638638
settings: {
639+
type: {
640+
label: 'Plot Type',
641+
type: SELECTION_TYPES.LIST,
642+
values: ['line', 'scatter'],
643+
default: 'line',
644+
},
639645
backgroundColor: {
640646
label: 'Background Color',
641647
type: SELECTION_TYPES.COLOR,

0 commit comments

Comments
 (0)