Skip to content

Commit

Permalink
Added config option for setting minimum on y-axis of line graphs.
Browse files Browse the repository at this point in the history
  • Loading branch information
hylkevds committed May 4, 2017
1 parent 745d636 commit 20b1862
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 2 deletions.
5 changes: 5 additions & 0 deletions src/DashboardServices/LineGraphWidgetFactory.js
Expand Up @@ -428,10 +428,15 @@ export class LineGraphWidgetFactory {
labelTicks = this._calcLabelTicks(new Date(min), new Date(max), steps);
}

if (config.ymin === undefined) {
config.ymin = {data:0, type:0};
}

color = config.pointColor.data;
configurableOptions = {
xmin: min,
xmax: max,
ymin: config.ymin.data,
backgroundGridBorder: config.backgroundGridBorder.data,
backgroundGridVlines: config.backgroundGridVlines.data,
backgroundBarcolor1: config.backgroundBarcolor1.data,
Expand Down
Expand Up @@ -113,13 +113,17 @@ export class LineGraphWidgetData {
},

titleXaxis: {
data: 'Time in sec',
data: 'Time',
type: TYPE_STRING
},
titleYaxis: {
data: 'New 9gag memes',
data: 'Y-Axis',
type: TYPE_STRING
},
ymin: {
data: 0,
type: TYPE_NUMBER
},
pointColor: {
data: '#000000',
type: TYPE_COLOR
Expand Down
1 change: 1 addition & 0 deletions src/View/langEn.js
Expand Up @@ -95,6 +95,7 @@ export var en = {
"titleXaxis_Tooltip": "Title on the X Axis",
"titleYaxis_Tooltip": "Title on the Y Axis",
"pointColor_Tooltip": "Color of the Points to draw",
"ymin_Tooltip": "Minimum value on the Y Axis",

//PlainDataWidget
"valueSize_Tooltip": "Fontsize of the Value",
Expand Down
4 changes: 4 additions & 0 deletions test/DashboardServices/LineGraphWidgetFactoryTest.js
Expand Up @@ -101,6 +101,10 @@ describe("LineGraphWidgetFactory test", () => {
data: 'New 9gag memes',
type: TYPE_STRING
},
ymin: {
data: 0,
type: TYPE_NUMBER
},
pointColor: {
data: '#000000',
type: TYPE_COLOR
Expand Down

0 comments on commit 20b1862

Please sign in to comment.