In IOS chart Dialogue is not working

2 posts, 0 answers
  1. Paulson
    Paulson avatar
    50 posts
    Member since:
    Apr 2016

    Posted 09 Sep Link to this post

    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;
  2. Nikolay Iliev
    Admin
    Nikolay Iliev avatar
    92 posts

    Posted 09 Sep Link to this post

    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
Back to Top