Skip to content

Commit

Permalink
updated examples for onClick event parameter and usage of onChartDraw…
Browse files Browse the repository at this point in the history
…n in pieChartCustomLegend example
  • Loading branch information
pruhsert committed Mar 19, 2020
1 parent 00df2d6 commit 793c543
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
3 changes: 2 additions & 1 deletion svyChartJSExample/forms/orderDetail.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions svyChartJSExample/forms/pieChartCustomLegend.frm
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ location:{
x:5,
y:6
},
onChartDrawn:"FA113B1A-A017-49D7-9B3A-F254A49540A0",
size:{
height:307,
width:630
Expand Down
12 changes: 11 additions & 1 deletion svyChartJSExample/forms/pieChartCustomLegend.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

0 comments on commit 793c543

Please sign in to comment.