OLAP Pivot Chart: 2nd Y-Axis disappeared after calling refresh()

Posted by: james.ingham on 5 June 2020, 3:14 am EST

  • Posted 5 June 2020, 3:14 am EST

    Dear support,

    I use following code to add the 2nd Y-Axis on one of our Pivot Chart (In Angular):

    
    let s = pivotChart.flexChart.series[i];
    let axisY = new Axis();
    axisY.position = <any>'Right';
    axisY.axisLine = true;
    
    axisY.max = 1;
    s.chartType = ChartType.Line;
    
    axisY.title = "Currencies";
    axisY.format = "c2";
    
    s.axisY = axisY; 
    
    

    Note pivotChart is of class WjPivotChart. Above code works, however when I call:

    pivotChart.refresh()
    

    then the 2nd Y-axis disappeared. May I ask whether it is a bug, or there’s anyway that we can avoid this issue? We have to call pivotChart.refresh() because the data source may get updated.

  • Posted 8 June 2020, 12:40 am EST

    Hi Jason,

    When you call the refresh method, the PivotChart is re-created again. That is why the second axis is removed. To resolve this issue, instead of directly adding the second axis, handle the rendered event of the FlexChart instance and in the event handler, add the second axis.

    Let us know if this solves your issue.

    Regards,

    Ashwin

  • Posted 8 June 2020, 7:13 pm EST

  • Posted 8 June 2020, 11:48 pm EST

    Hi James,

    This is the refreshed event of PivotChart. I suggested to use rendered event of the flexchart:

    pivotChart.flexChart.rendered.addHandler(...)
    

    https://www.grapecity.com/wijmo/api/classes/wijmo_chart.flexchart.html#rendered

    ~regards

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels