on 05-18-2015 8:50 AM
Hey Folks,
I am trying to set the default selection for my pie chart on "onAfterRendering" Event of my controller so that when view loads there is default Selection of one of the slices of pie chart.
I tried with the following below code :-
View Code
"pieChartData":[
{
"days":">=15 Days",
"value":"35"
},
{
"days":"16-30 Days",
"value":"65"
},
{
"days":"31-45 Days",
"value":"95"
},
{
"days":"<45 Days",
"value":"15"
}
],
var pieChartDataSet = new sap.viz.ui5.data.FlattenedDataset("paymentAgingReport",{
dimensions:[{axis:1, name:'Days', value:'{days}'}],
measures:[{name:'Payments Due', value:'{value}'}],
data:{path:"/pieChartData"}
});
var pieChart = new sap.viz.ui5.Pie("reportChart",{
id : "pie",
width : "100%",
height : "250px",
dataset: pieChartDataSet,
selectData:oController.onSelectPieChart,
});
Controller Code
onAfterRendering: function() {
var data = [{"days":"31-45 Days", "value":"95"}];
sap.ui.getCore().byId("agingReportChart").selection(data);
},
But i checked while debugging, it is returning me false.
And i am also using the Tokens so that when user clicks on the slices of the pie chart, he get "Tokens" on the toolbar like filter. So i want to implement, when he closes any of the token then only that section of chart should become unselected.
Could you please help me in achieving this??
Thanks & Regards,
Deepak
Hi,
You are passing wrong array to method "selection". See correct array example below.
var data = [{
data: {"Days": "31-45 Days", "Payments Due":"95"}
}];
Code snippet - JS Bin - Collaborative JavaScript Debugging</title> <link rel="alternate" type=&q...
More information about Pie's selection method - JsDoc Report - SAP UI development Toolkit for HTML5 - API Reference - sap.viz.ui5.core.BaseChart
Regards,
Vladimir
Message was edited by: Vladimirs Semikins
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.