-
Notifications
You must be signed in to change notification settings - Fork 179
CartesianChartPropsMixin
This mixin provides common properties for all Cartesian-style charts.
Warning: since this software is still in its Alpha state, a chart that implements CartesianChartPropsMixin is NOT guaranteed to support all of its available properties.
(All properties can be overridden by passing in the property to the top level call of any chart that implements the mixin.)
-
axesColor - the fill color of the axes
- Type:
React.PropTypes.string
- Default:
'#000'
- Type:
-
colors - a function that generates a color to be used for a fill. This is often implemented as a d3 ordinal color scale
- Type:
React.PropTypes.func
- Default:
d3.scale.category20c()
- Type:
-
colorAccessor - this return value of function is passed into colors
-
Type:
React.PropTypes.func
-
Default:
(d, idx) => idx
whered
is the datum being operated on, andidx
is the index in the array of datums -
How it is used:
datumArray.map(function(d, idx) { var fill = props.colors(props.colorAccessor(d, idx)); // pass fill to whatever you want to color, such as a line on a LineChart });
-
-
data - this is the datum array, in the required format, that is passed into your chart
- Type:
React.propTypes.oneOfType([React.PropTypes.array, React.PropTypes.object])
- Default:
[]
- Type:
-
xAxisFormatter - a string formatting function for the x-axis
- Type:
React.PropTypes.func
- Default: none
- Type:
-
xAxisLabel - the x-axis label
- Type:
React.PropTypes.string
- Default: none
- Type:
-
xAxisLabelOffset - distance between the xAxisLabel and the y-axis
- Type:
React.PropTypes.number
- Default:
38
- Type:
-
xAxisTickCount - the number of ticks on the x-axis
- Type:
React.PropTypes.number
- Default: none
- Type:
-
xAxisTickValues - the values of the x-axis
- Type:
React.PropTypes.array
- Default: none
- Type:
-
xOrient - x-axis location
- Type:
React.PropTypes.oneOf(["top", "bottom"])
- Default
bottom
- Type:
-
yAxisFormatter - a string formatting function for the y-axis
- Type:
React.PropTypes.func
- Default: none
- Type:
-
yAxisLabel - the y-axis label
- Type:
React.PropTypes.string
- Default: none
- Type:
-
yAxisLabelOffset - distance between the yAxisLabel and the y-axis
- Type:
React.PropTypes.number
- Default:
35
- Type:
-
yAxisTickCount - the number of ticks on the y-axis
- Type:
React.PropTypes.number
- Default: none
- Type:
-
yAxisTickValues - the values of the y-axis
- Type:
React.PropTypes.array
- Default: none
- Type:
-
yOrient - y-axis location
- Type:
React.PropTypes.oneOf(["left", "right"])
- Default
left
- Type:
- Issues: react-d3 issues on Github
- Support: react-d3 Google Groups email list