fussmonkey
fussmonkey

Reputation: 678

Accessing Highcharts methods in Rally chart

I'm working on a custom burnup report for my department, and I have almost everything working. The last thing being requested is to have a box drawn on the chart around an iteration if it's considered a "hardening" or "regression" iteration, like so:

example image

From the Highcharts API, the addPlotBand() method seemed promising (see jsFiddle example), but I'm having a hell of a time figuring out how I can access the Highcharts methods from my Rally chart object.

When I try something like this:

myChart.xAxis[0].addPlotBland({
  from: 1.0,
  to: 3.0,
  color: '#FCFFC5',
  id: 'plot-band-1'
});

I get an error because xAxis is undefined. That makes sense, because myChart is a Rally.ui.chart.Chart object. I just don't know if there's a way to access the Highcharts methods.

Upvotes: 1

Views: 321

Answers (1)

Conner Reeves
Conner Reeves

Reputation: 1381

You can add plot bands directly in the "chartConfig" of the rallychart component like so:

chartConfig : {
    xAxis: {
        plotBands : [{
            from  : 1.0,
            to    : 3.0,
            color : '#FCFFC5',
            id    : 'plot-band-1'
        }]
    }
}

But if you need to add a plotband to an existing chart, use:

myChart.down('highchart').chartConfig.xAxis.plotBands.push(bandConfig);

Upvotes: 5

Related Questions