This is a migrated thread and some comments may be shown as answers.

In IOS chart Dialogue is not working

1 Answer 42 Views
Chart
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Paulson
Top achievements
Rank 1
Paulson asked on 09 Sep 2016, 07:07 AM
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;

1 Answer, 1 is accepted

Sort by
0
Nick Iliev
Telerik team
answered on 09 Sep 2016, 09:37 AM
Hi Paulson,

I am closing this thread as duplicate to the following one http://www.telerik.com/forums/nativescript-ui-pro-chart-e3270ce9be96

Please, follow your initial request in the link above, where a solution to your issue can be found.

p.p. The cause of your issue is the pointSelected index value under iOS and not the dialog module. Once again please refer to the original thread for additional details on that matter.

Regards,
Nikolay Iliev
Telerik by Progress
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Chart
Asked by
Paulson
Top achievements
Rank 1
Answers by
Nick Iliev
Telerik team
Share this question
or