Commit 69bf0ccf authored by David Anderson's avatar David Anderson
Browse files

categorical axis is now documented

parent ccc8b408
......@@ -33,7 +33,7 @@ export class CategoricalAxis<T extends string | number = string> extends BaseAxi
public getCategorySize: ( ( cat: T ) => number ) | undefined;
/**
* Determins the amount of pading between bands
* Determines the amount of pading between bands
* Will be treated as a number of pixels when set to 1 or higher
* Will be treated as a perctange when less than 1
*
......@@ -42,7 +42,7 @@ export class CategoricalAxis<T extends string | number = string> extends BaseAxi
*/
public innerPadding: number = 0.1;
/**
* Determins the amount of pading before first category and after last
* Determines the amount of pading before first category and after last
* Will be treated as a number of pixels when set to 1 or higher
* Will be treated as a perctange when less than 1
*
......
......@@ -25,7 +25,7 @@ export declare class CategoricalAxis<T extends string | number = string> extends
maxCategorySize: number | undefined;
getCategorySize: ((cat: T) => number) | undefined;
/**
* Determins the amount of pading between bands
* Determines the amount of pading between bands
* Will be treated as a number of pixels when set to 1 or higher
* Will be treated as a perctange when less than 1
*
......@@ -34,7 +34,7 @@ export declare class CategoricalAxis<T extends string | number = string> extends
*/
innerPadding: number;
/**
* Determins the amount of pading before first category and after last
* Determines the amount of pading before first category and after last
* Will be treated as a number of pixels when set to 1 or higher
* Will be treated as a perctange when less than 1
*
......
This diff is collapsed.
This diff is collapsed.
......@@ -196,9 +196,6 @@ All Axis will have these properties and configs unless otherwise specified.
* <strong>registerChart</strong>( charts: BaseChart<DataPoint> | BaseChart<DataPoint>[] ): BaseAxis
* Tells each provided chart to use this axis as its x or y axis ( determined by this axis orientation )
* <strong>valueToWidth</strong>( value: T ): number
* Bar Charts and Box plots use this method to determine how wide to draw their rectangles. If the default behavior, is not desired, you can overwrite this method to tell this axis how wide in pixels to tell the charts.
* <strong>resetZoom</strong>(): void
* Reset the zoom level to 1.
......@@ -206,9 +203,33 @@ All Axis will have these properties and configs unless otherwise specified.
* Set the zoom level for this axis. Values between 0 and 1, zoom out from the default view. Values greater than 1 zoom in.
### CategoricalAxis\<T\> <small>extends BaseAxis</small>
CategoricalAxis are axis non continuous domains. They require explicitCategories to be set. And any value datapoint that cannot find a cateogry will throw an error, so they should be filtered out before given to a list. By default, the size of each category will be the same such that when combined, they will fill the chart.
* <strong>explicitCategories</strong>( value: T ):
* An array of the categories that make up this axis domain. In order for changes in this to be detected, chartCanvas.beginRender() must be called.
* <strong>getCategorySize</strong>( value: T ): number
* If you want a category to be a certain size, you can set this method. It will overwrite minCategorySize and maxCategorySize.
* <strong>minCategorySize</strong>: number | undefined = undefined
* Ensure that categories will be no smaller than this. If there is not enough room on the axis, points will be drawn off canvas and not be seen.
* Note: this will be overwritten by getCategorySize
* <strong>maxCategorySize</strong>: number | undefined = undefined
* Ensure that categories will be no larger than this. This may cause the chart to not fill the given canvas.
* Note: this will be overwritten by getCategorySize
* <strong>innerPadding</strong>: number = 0.1
* Once the width for the category is determined,what percentage of that belongs to the space between categories. This value only determines the space in between categories. To set the space between the first and last category and the edge of the chart, set outerPadding
* <strong>outerPadding</strong>: number = 0.1
* Once the width for the category is determined,what percentage of that belongs to the space between the first and last category and the edge of the chart canvas. To set the space between the categories, set innerPadding
* <strong>valueToWidth</strong>( value: T ): number
This method will determine how wide a category on the axis will be given. By default, a CategoricalAxis will give each category the same width.
* <strong>tickLabelPosition</strong>: 'center' | 'stop' | 'start' = 'center'
* Tells the axis where to draw its label for the category.
* 'center' ( default ) is in the middle of the category.
* 'start' will draw it where the band begins.
* 'stop' will draw it where the band ends.
### ContinuousAxis\<T\> <small>extends BaseAxis</small>
Continuous axis. Where the value to pixel is determined using a linear scale mapped from the chart extents to the explicit bounds.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment