From 793c543b5fa25e69758a976638de1a88ead94ec3 Mon Sep 17 00:00:00 2001 From: pruhsert Date: Thu, 19 Mar 2020 15:13:48 +0100 Subject: [PATCH] updated examples for onClick event parameter and usage of onChartDrawn in pieChartCustomLegend example --- svyChartJSExample/forms/orderDetail.js | 3 ++- svyChartJSExample/forms/pieChartCustomLegend.frm | 1 + svyChartJSExample/forms/pieChartCustomLegend.js | 12 +++++++++++- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/svyChartJSExample/forms/orderDetail.js b/svyChartJSExample/forms/orderDetail.js index 493567d..714f76b 100644 --- a/svyChartJSExample/forms/orderDetail.js +++ b/svyChartJSExample/forms/orderDetail.js @@ -74,12 +74,13 @@ function onDataChangeChartType(oldValue, newValue, event) { * @param {Number} index * @param {string} label * @param {Number} value + * @param {JSEvent} event * * @private * * @properties={typeid:24,uuid:"C8507FD4-BC47-449E-9FCE-3ECE3BE36D20"} */ -function onClick(dataset_index, index, label, value) { +function onClick(dataset_index, index, label, value, event) { // record index that was clicked var fsIndex = index + 1; diff --git a/svyChartJSExample/forms/pieChartCustomLegend.frm b/svyChartJSExample/forms/pieChartCustomLegend.frm index a6e40bf..86c58de 100644 --- a/svyChartJSExample/forms/pieChartCustomLegend.frm +++ b/svyChartJSExample/forms/pieChartCustomLegend.frm @@ -8,6 +8,7 @@ location:{ x:5, y:6 }, +onChartDrawn:"FA113B1A-A017-49D7-9B3A-F254A49540A0", size:{ height:307, width:630 diff --git a/svyChartJSExample/forms/pieChartCustomLegend.js b/svyChartJSExample/forms/pieChartCustomLegend.js index d447fdb..dd2c4e9 100644 --- a/svyChartJSExample/forms/pieChartCustomLegend.js +++ b/svyChartJSExample/forms/pieChartCustomLegend.js @@ -49,7 +49,17 @@ function onShow(firstShow, event) { elements.chart.setData(data); elements.chart.setOptions(options); + elements.legend.putClientProperty(APP_UI_PROPERTY.TRUST_DATA_AS_HTML, true); +} + +/** + * @param {JSEvent} event + * + * @private + * + * @properties={typeid:24,uuid:"FA113B1A-A017-49D7-9B3A-F254A49540A0"} + */ +function onChartDrawn(event) { //use custom legend html and store it to a label elements.legend.text = elements.chart.generateLegend(); - elements.legend.putClientProperty(APP_UI_PROPERTY.TRUST_DATA_AS_HTML, true); }