Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat($point): New point parameter for LineChart #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tzvsi
Copy link

@tzvsi tzvsi commented Apr 22, 2020

This adds a point parameter for modifying color, opacity radius and stroke props on rendered SVG rather than using CSS-based modifiers.

LineChart({
    ...
    point: {
        radius: 8,
        fillOpacity: 0.7,
        color: '#ffffff',
        strokeWidth: 3,
        strokeColor: '#3388ff'
    }
    ...
})

Screenshot

This adds a `point` parameter for modifying color, opacity radius and stroke props on rendered SVG
Copy link
Owner

@jens-ox jens-ox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR! Added some minor remarks. Also, an additional example graph would be great!

@@ -80,6 +83,7 @@ export default class AbstractChart {
* @param {Function} [tooltipFunction] function that receives a data object and returns the string displayed as tooltip.
* @param {Array} [legend] names of the sub-arrays of data, used as legend labels.
* @param {String | Object} [legendTarget] DOM node to which the legend should be mounted.
* @param {Object} [point={ color: null, radius: 3, fillOpacity: 1, strokeWidth: 0, strokeColor: null }] point object specifying color, radius, fillOpacity, strokeWidth and strokeColor.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines +40 to +44
radius: this.point.radius || 3,
color: this.point.color || this.colors[index],
fillOpacity: this.point.fillOpacity,
strokeWidth: this.point.strokeWidth,
strokeColor: this.point.strokeColor
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

...this.point?

Comment on lines +122 to +125
const color = this.point.color || this.colors[index]
const fillOpacity = this.point.fillOpacity
const strokeWidth = this.point.strokeWidth
const strokeColor = this.point.strokeColor
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

...this.point?

@jens-ox
Copy link
Owner

jens-ox commented Apr 22, 2020

Also, rebasing to master should fix the build issues from Netlify 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants