I am just changing the isTotalHidden value, to show and hide it.
The only way I know of at this moment to get the chart to refresh is with viewparameter.RefreshAlladapters()
so my code looks like this:
var parentView = this.parentView;
var viewParameters = parentView.control.viewParameters;
var viewParameter = this.parentView.control.getViewParameterByName("viewParameter1");
if (chart1.isTotalHidden == false)
{
chart1.isTotalHidden = true;
button1.text = "Show Totals";
}
else
{
chart1.isTotalHidden = false;
button1.text = "Hide Totals";
}
viewParameter.invalidateParameterValueLastModifiedTime();
viewParameter.refreshAllAdapters();
Is there a refresh or reload chart?