This commit is contained in:
Violet Voronetzky 2020-11-18 17:57:29 +02:00
Родитель e32fa68aab
Коммит e29c668898
4 изменённых файлов: 19 добавлений и 19 удалений

Просмотреть файл

@ -65,7 +65,7 @@ chartHelper.draw(queryResultData, chartOptions);
| onFinishDataTransformation | Function(dataTransformationInfo: IDataTransformationInfo) : Promise&lt;boolean&gt; | Callback that is called when all the data transformations required to draw the chart are finished<br/>Callback inputs:<br/>&nbsp;&nbsp;&nbsp;&nbsp;[IDataTransformationInfo](#IDataTransformationInfo) - The information regarding the applied transformations on the original query results<br/>Callback return value:<br/>&nbsp;&nbsp;&nbsp;&nbsp;The promise that is used to continue/stop drawing the chart<br/>&nbsp;&nbsp;&nbsp;&nbsp;When provided, the drawing of the chart will be suspended until this promise will be resolved<br/>&nbsp;&nbsp;&nbsp;&nbsp;When resolved with true - the chart will continue the drawing<br/>&nbsp;&nbsp;&nbsp;&nbsp;When resolved with false - the chart drawing will be canceled | |
| onFinishDrawing | Function(chartInfo: IChartInfo) : void | Callback that is called when the chart drawing is finished <br/>Callback inputs:<br/>&nbsp;&nbsp;&nbsp;&nbsp;[IChartInfo](#IChartInfo) - The information regarding the chart | | |
| onFinishChartAnimation | Function(chartInfo: IChartInfo) : void | Callback that is called when the chart animation is finished <br/>Callback inputs:<br/>&nbsp;&nbsp;&nbsp;&nbsp;[IChartInfo](#IChartInfo) - The information regarding the chart | | |
| onDataPointClicked | Function(dataPoint: IDataPoint) : void | When this callback is provided, the chart data points will be clickable.<br/>The callback will be called after a click on a certain data point in the chart.<br/>Callback inputs:<br/>&nbsp;&nbsp;&nbsp;&nbsp;[IDataPoint](#IDataPoint) - The information regarding the values of the clicked data point.<br/>&nbsp;&nbsp;&nbsp;&nbsp;<b>Note</b> that the value of a date-time column in the dataPoint object will be its numeric value - Date.valueOf(). | | |
| onDataPointClicked | Function(dataPoint: IDataPoint) : void | When this callback is provided, the chart data points will be clickable.<br/>The callback will be called when chart's data point will be clicked, providing the clicked data point information.<br/>Callback inputs:<br/>&nbsp;&nbsp;&nbsp;&nbsp;[IDataPoint](#IDataPoint) - The information regarding the columns and values of the clicked data point.<br/>&nbsp;&nbsp;&nbsp;&nbsp;<b>Note</b> that the value of a date-time column in the dataPoint object will be its numeric value - Date.valueOf(). | | |
### IDataTransformationInfo
| Option name: | Type: | Details: |

Просмотреть файл

@ -324,9 +324,9 @@ export interface IChartOptions {
/**
* When this callback is provided, the chart data points will be clickable.
* The callback will be called after a click on a certain data point in the chart.
* The callback will be called when chart's data point will be clicked, providing the clicked data point information.
* Callback inputs:
* @param dataPoint - The information regarding the values of the clicked data point.
* @param dataPoint - The information regarding the columns and values of the clicked data point.
* Note that the value of a date-time column in the dataPoint object will be its numeric value - Date.valueOf().
*/
onDataPointClicked?: (dataPoint: IDataPoint) => void;

Просмотреть файл

@ -185,14 +185,6 @@ export abstract class Chart {
}
}
public /*virtual*/ verifyInput(options: IVisualizerOptions): void {
const columnSelection = options.chartOptions.columnsSelection;
if(columnSelection.splitBy && columnSelection.splitBy.length > 1) {
throw new InvalidInputError(`Multiple split-by columns selection isn't allowed for ${options.chartOptions.chartType}`, ErrorCode.InvalidColumnsSelection);
}
}
public /*virtual*/ getDataPoint(chartOptions: IChartOptions, point: Highcharts.Point): IDataPoint {
// Y axis
const yAxes = chartOptions.columnsSelection.yAxes;
@ -232,6 +224,14 @@ export abstract class Chart {
return dataPointInfo;
}
public /*virtual*/ verifyInput(options: IVisualizerOptions): void {
const columnSelection = options.chartOptions.columnsSelection;
if(columnSelection.splitBy && columnSelection.splitBy.length > 1) {
throw new InvalidInputError(`Multiple split-by columns selection isn't allowed for ${options.chartOptions.chartType}`, ErrorCode.InvalidColumnsSelection);
}
}
//#endregion Virtual methods
//#region Abstract methods

Просмотреть файл

@ -153,14 +153,6 @@ export class Pie extends Chart {
return '<table>' + tooltip + '</table>';
}
}
public /*override*/ verifyInput(options: IVisualizerOptions): void {
const columnSelection = options.chartOptions.columnsSelection;
if(columnSelection.yAxes.length > 1) {
throw new InvalidInputError(`Multiple y-axis columns selection isn't allowed for ${options.chartOptions.chartType}`, ErrorCode.InvalidColumnsSelection);
}
}
public /*virtual*/ getDataPoint(chartOptions: IChartOptions, point: Highcharts.Point): IDataPoint {
const seriesColumnName: string = point.series.name;
@ -197,6 +189,14 @@ export class Pie extends Chart {
return dataPointInfo;
}
public /*override*/ verifyInput(options: IVisualizerOptions): void {
const columnSelection = options.chartOptions.columnsSelection;
if(columnSelection.yAxes.length > 1) {
throw new InvalidInputError(`Multiple y-axis columns selection isn't allowed for ${options.chartOptions.chartType}`, ErrorCode.InvalidColumnsSelection);
}
}
//#endregion Methods override
protected getInnerSize(): string {