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

fix(core): add missing properties to AxisOptions interface #1432

Merged
merged 2 commits into from Sep 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 12 additions & 0 deletions packages/core/src/interfaces/axis-scales.ts
Expand Up @@ -126,6 +126,18 @@ export interface AxisOptions extends BasedAxisOptions {
percentage?: boolean;
}

export interface ComboChartAxisOptions extends AxisOptions {
/**
* should be set to `true` for the
* left axis to be the primary axis
*/
main?: boolean;
/**
* used to map data on the secondary axis
*/
correspondingDatasets?: Array<string>;
Comment on lines +130 to +138
Copy link
Member

Choose a reason for hiding this comment

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

Hi @metonym, we should probably find a way to have this only affect combo charts, since they mostly wouldn't apply to others

Copy link
Contributor Author

Choose a reason for hiding this comment

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

8b492e0

  • created a ComboChartAxisOptions interface
  • updated ComboChartOption.axes to use ComboChartAxisOptions

Choose a reason for hiding this comment

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

@theiliad, I don't get it. Why shouldn't I use these properties in ScatterChartOptions as described in my example in #1413? For me, this issue doesn't seem to be fixes as I was trying to use them in a ScatterChartOptions.

}

export interface BinnedAxisOptions {
/**
* should be set to `true` on the domain
Expand Down
2 changes: 2 additions & 0 deletions packages/core/src/interfaces/charts.ts
Expand Up @@ -20,6 +20,7 @@ import { BarOptions, StackedBarOptions, ToolbarOptions } from './components';
import {
AxisOptions,
BinnedAxisOptions,
ComboChartAxisOptions,
TimeScaleOptions,
} from './axis-scales';

Expand Down Expand Up @@ -451,6 +452,7 @@ export interface RadarChartOptions extends BaseChartOptions {
* options specific to combo charts
*/
export interface ComboChartOptions extends AxisChartOptions {
axes?: AxesOptions<ComboChartAxisOptions>;
comboChartTypes: Array<{
type: ChartTypes | any;
options?: object;
Expand Down