This question is locked. New answers and comments are not allowed.
Hi,
Chart dialogue is not working in IOS but in Android the same code is working perfectly code i have given below
XML:-
<chart:RadCartesianChart id="pieChart chart" pointSelected="selectedIndex" selectionMode="Single" height="350" showLabels="false">
<chart:RadCartesianChart.series>
<chart:BarSeries
seriesName="Bar1"
categoryProperty="name"
items="{{ info.chartSource1 }}"
valueProperty="ExpenseOther"
stackMode="Stack"
showLabels="true"
selectionMode="DataPoint">
<chart:LineSeries.labelStyle>
<chart:PointLabelStyle margin="10" fillColor="#FF9900" textSize="10" textColor="#fff" />
</chart:LineSeries.labelStyle>
</chart:BarSeries>
<chart:BarSeries
seriesName="Bar"
items="{{ info.chartSource1 }}"
valueProperty="Expenses-Direct - BSG"
selectionMode="DataPoint"
stackMode="Stack"
categoryProperty="name"
showLabels="true">
<chart:LineSeries.labelStyle>
<chart:PointLabelStyle margin="10" fillColor="#FF2200" textSize="10" textColor="#fff" />
</chart:LineSeries.labelStyle>
</chart:BarSeries>
<chart:BarSeries
seriesName="Bar2"
valueProperty="Direct Income - BSG"
items="{{ info.chartSource1 }}"
selectionMode="DataPoint"
stackMode="Stack"
categoryProperty="name"
showLabels="true">
<chart:LineSeries.labelStyle>
<chart:PointLabelStyle margin="10" fillColor="#34C511" textSize="10" textColor="#fff" />
</chart:LineSeries.labelStyle>
</chart:BarSeries>
<chart:LineSeries seriesName="Line" items="{{ info.chartSource1 }}" categoryProperty="name" valueProperty="netProfit" selectionMode="Series" showLabels="true">
</chart:LineSeries>
<chart:LineSeries seriesName="Line1" items="{{ info.chartSource1 }}" categoryProperty="name" valueProperty="demo" selectionMode="Series" showLabels="true">
</chart:LineSeries>
</chart:RadCartesianChart.series>
<chart:RadCartesianChart.horizontalAxis>
<chart:CategoricalAxis
labelTextColor="#cb4b16" />
</chart:RadCartesianChart.horizontalAxis>
<chart:RadCartesianChart.verticalAxis>
<chart:LinearAxis lineHidden="true"/>
</chart:RadCartesianChart.verticalAxis>
</chart:RadCartesianChart>
JS:-
function selectedIndex(args) {
console.log(chartSource1)
popupArr = []
var barAttributes = chartSource1["chartSource1"].getItem(args.pointIndex);
var monthName = barAttributes.name
objKeys = Object.keys(barAttributes);
objKeys.forEach(function (item) {
if(item == "name" || item == "netProfit" || item == "demo" ){
console.log("no need of the value")
}
else{
popupArr.push(item);
}
})
var options = {
title: monthName,
message: "Choose your race",
actions:popupArr,
cancelButtonText: "Cancel"
};
dialogs.action(options).then((result) => {
if(result != "Cancel") {
var navigationOptions={
moduleName:'views/profit/popupProfit',
context:{param1: result,
param2: monthName,
param3: allDatArr
}
}
frameModule.topmost().navigate(navigationOptions);
}
});
// console.log("selectedIndex "+JSON.stringify(navigationOptions));
}
exports.selectedIndex = selectedIndex;
Chart dialogue is not working in IOS but in Android the same code is working perfectly code i have given below
XML:-
<chart:RadCartesianChart id="pieChart chart" pointSelected="selectedIndex" selectionMode="Single" height="350" showLabels="false">
<chart:RadCartesianChart.series>
<chart:BarSeries
seriesName="Bar1"
categoryProperty="name"
items="{{ info.chartSource1 }}"
valueProperty="ExpenseOther"
stackMode="Stack"
showLabels="true"
selectionMode="DataPoint">
<chart:LineSeries.labelStyle>
<chart:PointLabelStyle margin="10" fillColor="#FF9900" textSize="10" textColor="#fff" />
</chart:LineSeries.labelStyle>
</chart:BarSeries>
<chart:BarSeries
seriesName="Bar"
items="{{ info.chartSource1 }}"
valueProperty="Expenses-Direct - BSG"
selectionMode="DataPoint"
stackMode="Stack"
categoryProperty="name"
showLabels="true">
<chart:LineSeries.labelStyle>
<chart:PointLabelStyle margin="10" fillColor="#FF2200" textSize="10" textColor="#fff" />
</chart:LineSeries.labelStyle>
</chart:BarSeries>
<chart:BarSeries
seriesName="Bar2"
valueProperty="Direct Income - BSG"
items="{{ info.chartSource1 }}"
selectionMode="DataPoint"
stackMode="Stack"
categoryProperty="name"
showLabels="true">
<chart:LineSeries.labelStyle>
<chart:PointLabelStyle margin="10" fillColor="#34C511" textSize="10" textColor="#fff" />
</chart:LineSeries.labelStyle>
</chart:BarSeries>
<chart:LineSeries seriesName="Line" items="{{ info.chartSource1 }}" categoryProperty="name" valueProperty="netProfit" selectionMode="Series" showLabels="true">
</chart:LineSeries>
<chart:LineSeries seriesName="Line1" items="{{ info.chartSource1 }}" categoryProperty="name" valueProperty="demo" selectionMode="Series" showLabels="true">
</chart:LineSeries>
</chart:RadCartesianChart.series>
<chart:RadCartesianChart.horizontalAxis>
<chart:CategoricalAxis
labelTextColor="#cb4b16" />
</chart:RadCartesianChart.horizontalAxis>
<chart:RadCartesianChart.verticalAxis>
<chart:LinearAxis lineHidden="true"/>
</chart:RadCartesianChart.verticalAxis>
</chart:RadCartesianChart>
JS:-
function selectedIndex(args) {
console.log(chartSource1)
popupArr = []
var barAttributes = chartSource1["chartSource1"].getItem(args.pointIndex);
var monthName = barAttributes.name
objKeys = Object.keys(barAttributes);
objKeys.forEach(function (item) {
if(item == "name" || item == "netProfit" || item == "demo" ){
console.log("no need of the value")
}
else{
popupArr.push(item);
}
})
var options = {
title: monthName,
message: "Choose your race",
actions:popupArr,
cancelButtonText: "Cancel"
};
dialogs.action(options).then((result) => {
if(result != "Cancel") {
var navigationOptions={
moduleName:'views/profit/popupProfit',
context:{param1: result,
param2: monthName,
param3: allDatArr
}
}
frameModule.topmost().navigate(navigationOptions);
}
});
// console.log("selectedIndex "+JSON.stringify(navigationOptions));
}
exports.selectedIndex = selectedIndex;