Skip to content

Commit 123a2bd

Browse files
committed
Added default style to overlay button.
1 parent 69ac8a0 commit 123a2bd

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

example/DrillDown.js

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,11 @@ class DrillDown extends React.Component {
2323
height: 400,
2424
dataFormat: 'json',
2525
dataSource: this.props.dataSource,
26-
}
26+
},
27+
borderColor: (this.props.overlayBtn && this.props.overlayBtn.borderColor) ? this.props.overlayBtn.borderColor : '#000',
28+
backgroundColor: (this.props.overlayBtn && this.props.overlayBtn.backgroundColor) ? this.props.overlayBtn.backgroundColor : '#F6F6F6',
29+
color: (this.props.overlayBtn && this.props.overlayBtn.color) ? this.props.overlayBtn.color : '#000',
30+
fontSize: (this.props.overlayBtn && this.props.overlayBtn.fontSize) ? this.props.overlayBtn.fontSize : '14px'
2731
};
2832
}
2933

@@ -45,13 +49,13 @@ class DrillDown extends React.Component {
4549
}
4650

4751
render() {
48-
// In-line style for button
52+
// In-line style for overlay button
4953
const btnStyle = {
50-
border: `1px solid ${this.props.overlayBtn.borderColor}`,
51-
backgroundColor: `${this.props.overlayBtn.bgColor}`,
52-
color: `${this.props.overlayBtn.fontColor}`,
54+
border: `1px solid ${this.state.borderColor}`,
55+
backgroundColor: `${this.state.backgroundColor}`,
56+
color: `${this.state.color}`,
5357
fontFamily: 'Verdana, sans',
54-
fontSize: `${this.props.overlayBtn.fontSize}`,
58+
fontSize: `${this.state.fontSize}`,
5559
padding: '3px',
5660
fontWeight: 'bold',
5761
position: 'absolute',
@@ -60,8 +64,6 @@ class DrillDown extends React.Component {
6064
cursor: 'pointer',
6165
};
6266

63-
console.log(btnStyle);
64-
6567
return (
6668
<div style={{
6769
position: 'relative',
@@ -70,7 +72,7 @@ class DrillDown extends React.Component {
7072
<div style={{position: 'relative'}}>
7173
<span style={btnStyle}
7274
onClick={() => this.setState({ showDrillDown: false })}>
73-
{this.props.overlayBtn.message}
75+
{this.props.overlayBtn && this.props.overlayBtn.message ? this.props.overlayBtn.message : 'Revert'}
7476
</span>
7577
{this.props.children[this.state.selectedChild]} {/* Displaying Correct Drilled Down Chart. */}
7678
</div> :

example/Example.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ class Example extends React.Component {
123123
super(props)
124124

125125
this.state = {
126-
mappedIds: [0, 1, 2, 3],
126+
mappedIds: [0, 1, 2],
127127
dataSource: {
128128
chart: {
129129
caption: 'PARENT',

0 commit comments

Comments
 (0)