-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
EZEE-3479: As a developer I want to have reusable componenet for charts #1705
EZEE-3479: As a developer I want to have reusable componenet for charts #1705
Conversation
getScalesYAxesOption() { | ||
let YAxes = []; | ||
|
||
if (this.type === 'line') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this.type
this is never set in this base class and this class definitely should not know what are the values of this properties
f35f17f
to
3a81701
Compare
checkbox.style.backgroundColor = checkedColor; | ||
checkbox.style.borderColor = checkedColor; | ||
} else { | ||
checkbox.style.backgroundColor = '#fff'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would put colors to constants at the beginning of file
|
||
render() { | ||
this.chart = new Chart(this.canvas.getContext('2d'), { | ||
type: this.getType(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getType
is not defined in this class
options: { | ||
responsive: true, | ||
maintainAspectRatio: false, | ||
layout: this.layoutOptions(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
layout: this.layoutOptions(), | |
layout: this.getLayoutOptions(), |
?
chartNode.classList[chartMethod]('ez-chart--no-data'); | ||
}, | ||
}, | ||
scales: this.scaleOptions(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
scales: this.scaleOptions(), | |
scales: this.getScaleOptions(), |
?
}; | ||
} | ||
|
||
legendOptions(chart) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
legendOptions(chart) { | |
getLegendOptions(chart) { |
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
QA approved on Ibexa dxp 3.3.1-dev with patch.
Added reusable component for chart
Checklist:
$ composer fix-cs
)